ASCII art puzzle discussion

Doing this challenge with bash is a nightmare !

You have to take of so many “glitches”:

  • space are trimed when reading
  • backslash are interpreted when reading (in the other ascii representation …)
  • point is a special char in many command (yes I look at you Lorem Ipsum ;))

But, finally did it.
Micht69

2 Likes

Test case for another ascii is broken. (At least for the input available for download, but I suspect that the same happens to the last test case as well)
In the first row of ascii representation, every letter start and end with SPACE, except for letter N that do not have a space in front of it.
Probably one can pass the test by hacking out this behavior but, even so, the input for the test is clearly against the specs.

Get it 100% from the first attempt. Gotcha was the Question Mark statement :stuck_out_tongue: LOREM?IPSUM, this is because ot the failure for people to understand the problem.

Also, the Topic said it’s all to storage in arrays? Definitely no. Not EVEN SINGLE array was used here.
Scanline by scanline, while reading the scanlines in the empty loop I immediately rendered a line on STDOUT and the test passed :stuck_out_tongue: However, this one should fail in Interactive mode in consoles as becasuse as soon as you input a scanline, an output scanline is rendered. But my solution passed with score 100% :stuck_out_tongue:

The topic is for beginner and what they have to learn to code a solution for the puzzle.

For example, Thor 1 can be solve without a single if: Complex Number, Angle or Pathfinding but that is not the purpose of easy puzzles.

Should the program read the input from the given in.txt file??

You can try it but your code won’t pass the validators.

The input file for the different ASCII representation test case is invalid per the specs of the program. Please take a look at the formatting on the top line for the letter ‘N’. There is one less space here than for the other letters and is causing a failure on this test case. It is possible to hard code around this fault but it would be a much more enjoyable learning experience, and less frustrating, if elegant code that meets the rules can pass all tests.

1 Like

Hi,

There is no invalid input/output for this puzzle. It’s your code that add the space.
The only bug is the display in the console but it does not matter for the result.
Here is the pretty display : https://www.codingame.com/ide/fileservlet?id=425439551199

> Fail
> Found:    " .----------------.  .----------------.  .----------------- "
> Expected: " .----------------.  .----------------.  .-----------------."

“Found” is YOUR print line.
“Expected” is the expected print line. :slight_smile:

1 Like

SaiksyApo, would you mind scanning over my code and seeing where the extra space may be coming from? I would deeply appreciate it as I feel that I have the logic down solid and cannot find where this would be coming from. I will also delete my previous post to avoid confusion for future solvers if this is truly the case. (code may be found below) Thank you!


[EDIT: NO FULL CODE BUT I ALREADY CHECKED IT]

I don’t know how to python, so your code is pretty hard to read for me , anyway, i create a small code :
line 27. just before your if(len(T)…). It will display the letter of the word and i’m able to see that your code have the good input even for the letter ‘N’. (The N have 17 - when some other letter have 16 -)

for c in range(len(T)):
        for i in range(H):
            print >> sys.stderr,  ROW[i][L * code[c]:L * code[c] + L]
        print >> sys.stderr, " "

You have weird code with something like L-1 in your display function so maybe the bug is here. Double check your code, I can’t help you. :stuck_out_tongue:

Hey how to split the ROW for the last one? I tried to make a ROWS array for every single line, it worked well for the first 4 test, but at the last it didn’t because the ,first line" is in actually more lines, I mean i made like:

for (int i = 0; i < H; i++)
{
ROWS[i]=Console.ReadLine();
}

I am having trouble with the Lorem ipsum test, having passed all the others already.

A few quick questions, I assume that the “space” is supposed to be output as an ASCII “?” character, is that correct?

If that is correct, my code should already handle the case, because when I parse the original text, I already have a line that “converts” anything less that A (65) (in JAVA):
if (letterAsA < 65 ) {
letterInput[i] = (char) (63); // 63 is ?
}
and it handles the “@” and “!” cases already just fine.

I know very little about programming in general, but is it because a “space” is read differently? If not, can someone give me a push in the right direction. Thank you in advance.

Yes, it’s in the third line of the output format instruction.

Oh man, I’m an idiot. I declared an array with a size of 27, not the size of the actual length of the input string. So, Lorem Ipsum would get to the second “.” at the end, and be out of range. I’ve learned a lesson today. Don’t be dumb :wink:

The validator for Lua seems to be broken. My code passed all the test cases shown in the IDE, but failed for the ones which run on clicking the Submit button. However, the same code, when ported to JavaScript, passed all the tests.

it would be nice if a list of broken validators were to be maintained, as it would help save the time and efforts.

Bonjour,

Tout fonctionne chez moi, j’ai balayé tous les caractères ascii de 0 à 127, et le résultat est satisfaisant. Pourtant, je ne passe pas le test “Lorem Ipsum…”. J’utilises Bash/vim.
L’alphabet change-t-il pour cette épreuve ?
Que contient le texte “Lorem ipsum…” qui fait planter ?
Que ceux qui savent partagent.
Merci.

Hello

Everything works fine on my computer. I have verified the code from 0 to 127 and the result is good. However, I can’t pass the “Lorem ipsum …” test. I use Bash/vim.
Is alphabet changed for this test ?
What can be found in the “Lorem ipsum …” text that crashes the program ?
If you know, share it.
Thank you.

Non alphabetic charcaters are coded by ?, all of them.

???abcdefghijklmnopqrstuvwxyz???abcdefghijklmnopqrstuvwxyz???

Voilà les 128 caractères de l’ascii passant par mon script. Et ça ne marche pas.
Here are the 128 ASCII characters processed by my script. And it doesn’t work.

The ASCII art alphabets are not the same in the different tests.

Ok. My fault, and I knew it. I was using an exotic character as a separator hoping that the ASCII art alphabet won’t have one in. But the ASCII art alphabet is exotic too :smiley:
Puzzle complete.
Go, go, go! :wink: