ASCII art puzzle discussion

range(97, 122) only goes to 121 so “z” is skipped.
A simpler way to check this would be:
if “a” <= x <= “z”

Also please remove your code, you’re not supposed to post almost working code here.

1 Like

Thank you very much. I’ll try to figure out what is the problem with my code.

Now it works. I just had to suppress the space handling which I transposed as a normal space and not as a question mark.

Thank you for your help.

I’ve added a test case in the IDE with spaces.

1 Like

Why Console.SetCursorPosition() does not work on this site for C#?

I don’t know how can I guess the “another ASCII representation” too :frowning:

Yeah, I don’t believe that test case is set up correctly. For some reason, they want you to print the letter “N” twice, in 2 different ways. The first N begins with .----------------- while the second begins with .----------------. - this seems like an oversight, was that test case accidentally modified?

The letter “N” is printed the same way.
You can check the expected output - menu button in top right corner of the Test Cases section.

1 Like

Does this puzzle require 2d Arrays to solve?

You can use 2d arrays to solve it, but I’ll not say that it’s required.
The containers to use will also depend of the language.

1 Like

It’s confused for me that when I using the java to solve the case 5, the running result shows me different length of the result for last character. I believe it should contains ----------------- this long. But the expected answers has one more char length in each line than my running answer. So, can you check your original date resource or I had the mistake in my coding.

Can you check your own source code before asking the problem owner to check their setting?
Learn to read the statistics of that puzzle. When there are nearly 100k submission successfully passed but your code did not pass, who is more likely to be incorrect?

1 Like

is there a way i can see the way the test codes are exicuted? id like t understand how the symbols are inputted to the code. PLEASE. Iv been stuck on on this for about 2 weks and i have no idea where to go here.

This is where the debug messages are to be used.
Depending on the language you are using, there are different commands to display a debug message. Usually this debug command is included in the default given starting code. Some examples:

in javascript,
// To debug: console.error('Debug messages...');

in python
# To debug: print("Debug messages...", file=sys.stderr, flush=True)

in C
// To debug: fprintf(stderr, "Debug messages...\n");

After reading in an input value, you can display the variable by debug, to confirm the data is indeed correctly read and in correct structure.
After some calculations, you can display the variables again to check is the calculation correct.

e.g. in javascript

r = parseInt(readline());
console.error('r = ' + r);
c = Math.PI * r * 2;
console.error('c = ' + c);

These err outputs are not counted into your answer output (std out)

1 Like

Has anyone done this in Haskell? It must feel like a lot of pain and suffering…

no pain…
if you have the good algorithm

It’s given to you in the variable called “row”. If you print ‘row’ from the beginning, you will see the ASCII art of the letters, starting in the bottom row of the character. If you look at the Example 1 output, you can see the pattern. The idea is to “split” that one row. I hope this helps

1 Like

I had this same issue in Python. It drove me nuts for hours! I poured over my code trying to find the issue - nothing was hardcoded and all the other tests pass. Finally, I just decided to print what was inputted and got the same results. It looks like somewhere there is a glitch in the input for that test case with the ASCII input, such as newline characters were introduced in places they shouldn’t have been. I submitted my code anyway for a 90% pass. BTW - I solved this one a couple of years ago in C# and had not issues - I had passed all of the test cases, so something changed.

To print the output, declare a list ( I called it matrix) and then append the contents of row to matrix:

matrix = []
l = int(input())
h = int(input())
t = input()
for i in range(h):
row = input()
matrix.append(row)

then, print the contents of matrix to see all of the inputted data:

for j in range(h):
print(matrix[j]

I hope this helps

I think there’s an issue in test case 5 input for the ascii character top row input. I think there may be an extra ‘-’.