[Community Puzzle] Retro Typewriter Art

I think C is a good choice :wink: you will make a lot of things that you can’t do with Python.

1 Like

cool way of experimenting with encoding, love the ascii art

1 Like

Just wanted to say this was a cool puzzle. I went through all the test cases manually just to see the pictures after getting them all green with the test all button.

1 Like

That was really fun puzzle :smiley: loved the test cases.

1 Like

The test were really fun but although I passed all the test, the validator said I failed #7 : Impossible Triangle Validator. Could someone help me where I went wrong?

Hey 5am –
Thanks for playing my puzzle. I just double-checked the impossible-triangle validator and it really is the same thing as the actual test (only a smaller size). There’s no stray extra spaces or anything. If you want I can private message you the input. But I am baffled as to why the validator would fail.

@Lisa-Has-Ideas any chance you’d be willing to share your program for creating the recipes from the ASCII art? I’d love to take a look at how you tackled that

Sure. I just sent a direct message to you (on Codingame).

How do i input the code? im stupid

Hi Hermione – When you click “Play TestCase” or “Play all testcases” or “Submit”, that runs your code, including inputting the values.

Is that what you were asking? If not, please re-phrase and ask again.

(Also cats aren’t stupid)

Hi everybody,

Thank you Lisa-Has-Ideas for this puzzle !

I’m trying to solve it in Javascript, but I don’t understand the error message:
“TypeError: Cannot read properties of undefined (reading ‘match’)”

My code is:

Summary
const T = readline();
const letters= T.split(" ");
var answer=[];
var re = /\d/;

for(i=0; i<=letters.length; i++){
    var item = letters[i];
    
    if(item.match(re)){
    var number = parseInt(item.match(re));
    
    var instructions = item.replace(number,"");
   
        if(instructions=="sp"){
            instructions=" ";
         }
        else if (instructions=="bS"){
        instructions="\\";
        }
        else if(instructions=="sQ"){
        instructions="'";
        }
        
        for(y=1; y<=number; y++){
        answer.push(instructions);
        }
    }
   else if(item=="nl"){
    answer.push("\n");
    }
    
   
        
};

console.log(answer.join(''));

If somebody could tell me what I’m doing wrong, I would be very grateful…

Thanks a lot !

Wombat85

1 Like

Hint for debugging:

Add a line:

console.error(letters);

Then look at these two lines:

for(i=0; i<=letters.length; i++){
    var item = letters[i];

The “for loop” will go through letters[0], letters[1], …, etc, and what does i equal to in the last iteration of the “for loop”?

Thank you so much ! :smiley:

Cool and easy puzzle, had a little fun

1 Like

This was interesting, beautiful and fun to do; I know there was work in encoding the art (and much thought too) - Thank you for this exercise!

1 Like

Thank you for the kind words.

Actually the encoding was really not that hard; the true work was done by the creators of the art itself.

I’m just so tickled that so many players have enjoyed this🙂

Yes thanks for this great puzzle! It was a pleasure to solve,and the artwork at the end was a beautiful reward :slight_smile:

1 Like

Thank you for the kind works. I’m so glad players enjoy this so much :smile_cat:

Hey Guys :wave: I have a curious little Problem with my Python script that i somehow cant wrap my head around: If i pass \\ to put a single backslash in my answer string it will not do it as it prints both

inputs = [“1bS”]

if “bS” in inputs[i]:
for _ in range(int(number)):
answer += “\\”
print(answer)

Standard Output Stream:
\\

However Python will not let you pass a single \ as it is treated as a breakout character.

inputs = [“1bS”]

if “bS” in inputs[i]:
for _ in range(int(number)):
answer += “\”
print(answer)

Errors

SyntaxError: EOL while scanning string literal

at Answer.py. not in a function on line 31

I have also tried using char("\"), r’\', r’\', str(answer) or even trying to just force one of them in by taking only the first entry of an created string (tmp = "\" answer = tmp[0]) however none of these will actually do what i need. Any ideas of how to solve this ?

Edit: just found out that this textbox also removes one \ if you have it in a text this is two backslashes after each other ==> \

Maybe you have some other errors in your code?

If the code is:
print("\\")
then the output is one backslash, not two.