[Community Puzzle] Escape the madness - Puzzle discussion

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

Created by @Cakeisalie5,validated by @Ribak,@Chewys512 and @JeZzElLutin.
If you have any issues, feel free to ping them.


I tried to do this puzzle in C. I passed all the testcases, but I keep failing the “Only known HTML entities” validator. I tried building in several additional checks, but my code does not pass the validator, while it passes the testcases every time.
Could you help me by explaining the difference between the “Only known HTML entities” testcase and the “Only known HTML entities” validator?

In the validator, there is one &#nn; where nn actually consists of 4 digits. This is not featured in any visible test. I’ve requested the author to adjust the test and the validator to fix the issue.

Thank you,

It turned out that the validator included some characters that are part of the Unicode mapping but not of the ascii mapping, while all characters in the testcases could be mapped as ascii characters. The validators therefore required the use of wide characters rather than regular characters, while the test cases could be solved with regular character strings.

It turned out to be a nice puzzle in the end!

I’ve just seen this problem (C++) … maybe the author should swap the validator and the test ?
Or just remove the 4 digit code, it’s very boring to solve this case in C++ :smile:

I tried with [wstring, wcin and wcout] instead of [string, cin and cout] : it doesn’t work.

Trouvé :
Others such as $ ($), % (%) or even € (EUR) shouldn't work either.
Attendu :
Others such as $ ($), % (%) or even € (\-30\-126\-84) shouldn't work either.

How can the validator wait for that ?

I think it’s unsolvable in C++

wcout << L"I want to print €" << endl;
// I want to print EUR

Hi, as described by @5DN1L my validator covered a case not covered by any test, which is indeed a mistake on my part. It should be fixed and actually fail in the corresponding test now! :slight_smile:

Hi all,
I’m trying to solve using Typescript.
Passing all test cases but failing one validator (6 - Only HTML entities).

Not sure if error on my part or something similar to javascript limitation discussed here;

Any help greatly appreciated.

Hi, could you give more details on the failure, e.g. the result you obtain and which native functions you use to parse/replace tokens? :slight_smile:

Thanks for the quick reply Cakeisalie5.
Sorry, not sure how to get details of inputs / results for validator - is this possible? If I could do it this would make finding the code problem much easier :slight_smile:

Description of code / functions for the HTML changes as this is the failing validator.
Hopefully it’s hidden to avoid spoilers - my first time posting.


1 - Replace the html unicodes using string.replace(regexp, replacerFn using parseInt).
2 - Use replaceAll (polyfill declared at top) for the HTML entities (via search / replace as key / value for an object), making sure to do & last.

Full code details as below (hopefully hidden);