[Community Puzzle] The broken editor

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

Created by @Fanfouer,validated by @TheSwine,@Alcalyn and @dinobogan.
If you have any issues, feel free to ping them.


I’m trying to solve this puzzle in python, my solution passes all test cases in IDE but when I submit it it fails to pass validator 007.
I’ve tried putting test case 007 into custom data and it fails because last space in input string is somehow lost when I run the code.

The input string of validator 007 does not end with a space, so the issue is probably something with your code.

Thank you, I’m looking into it.

I can confirm that 007 test case is a failure

1 Like

I solved the puzzle with C++. It succeeds when running all the standard tests, but fails when running the 007 test from the custom test. For some reason the last space is dropped from stdin.

I solved the puzzle in Python with the same result. The last space (or spaces) are dropped when running 007 in the custom test window.

Probably a bug not specific to this particular puzzle, but more about the CG website itself? If I remember correctly, I encountered a similar issue for some other puzzles.

as a work around for the space at the end of test 007, I remove spaces at the beginning and at the end of the string from the input . So no more space ! And all test pass successfully.
But validators 003 and 006 fails for me.
A question for the author:
Is-it possible to have more tests here for example ? I would like to test my code on more tests… Don’t put the validators tests of course but others tests so I can test again my code.
Beacuse right now, i have no more clue on how to improve my code to validate the puzzle…

Thank you

It doesn’t look like the author is still active…

I don’t have to trim any spaces in my solution. I guess you have to change the code so that it can work properly without initially removing spaces from the input string?

1 Like

Hi everyone.
For the 007 testcase, there is indeed an issue because the input line has a space at the end.
On c++ solutions, the getline command to get the string doesn’t include additional space before or after the string, so it doesn’t work. Hence, you can’t rely on the default code to get your input string. Good luck finding something else !

I fail to understand what is the purpose of < and > ; whats the difference between kkk<< m>>>kkk and kkk<< m>>>>>>>>>kkkk;

I understand that you have to have balanced expressions or else you get the wrong result like:
.<on<<"B>>d> me

1- on.<<"B>>d> me
2- <"Bond> me

But respecting that rule you end up with: “Bond. James Bond.” 7<00<

So there are no rules at all? what is the rule for that you do the substitution? Is that a “<” matches any “<” and “>” ? Is there an easier way? thanks

Imagine you’re using a word processor. There’s no rule stating that you must press the left arrow and the right arrow the same number of times. You aren’t prevented from keeping pressing “>” at the end of the text; just that it won’t have any effect (e.g. there’s no difference between kkk<< m>>>kkk and kkk<< m>>>>>>>>>kkkk except that you get an extra k for the second one because you type one more k).

Hi y’all, puzzle creator here.

The 007 test case seems to be a struggle for many. If you’re one of them, make sure that your code considers spaces as any other character. Don’t trim the input for example, since the 007 test case has a space among the last typed keys.

I also added an Out of bounds 2 test case to have the expected behaviour better explained when it comes to boundaries.

@nguyen.lam did you make it work in the end?
@Razovsky getline() seems to include the last space, do you still have that issue?

Thanks a lot @5DN1L for helping people until now, I made sure to subscribe to this topic in case of future questions :pray:

Good luck!

1 Like

New test case added :white_check_mark:

Further explaining in my answer below :arrow_down_small: