ASCII art puzzle discussion

I also think that some descriptions are just not detailed enough.

Input

Line 1: the width L of a letter represented in ASCII art. All letters are the same width.

Line 2: the height H of a letter represented in ASCII art. All letters are the same height.

Line 3: The line of text T, composed of N ASCII characters.

Following lines: the string of characters ABCDEFGHIJKLMNOPQRSTUVWXYZ? Represented in ASCII art.

so
“for i in xrange(h):
row = raw_input()”

gives me what exactly?
does it go through the first row from left to right, then the next, row, etc., putting all that stuff behindt one another?

or does it give me some array of arrays, where each inner array contains one line?
or an array of strings where each sring contains the symbols of one line?

and how is that supposed to help me if I get some “** *** * *** * * * * *** * ** ** *” as
input which by some weird formatting should display “1 2 3” in ascii art?

I say that we should somehow be able to actually view the input we get.

cause currently I have o downright guess what the input will look like as the raw_input() function doesnt even tell me what the f*ck it is gonna give me, if it’s some integer, a string, an array, or something completely different?

given that some weird int(raw_input()) function exists doesn’t really make it any easier :-/

Example :

letter E is represented as follow :

xxx
x
xxx
x
xxx

you will have L = 3 and H = 5.

so you’ll have for each raw_input (H times) have to split the string by 3 char to get all chars [A-Z] + ?

better ?

PS : Don’t forget in Python you can debug with

print(“Debug messages…”, file=sys.stderr) //Python3
print >> sys.stderr, “Debug messages…” //Python

for better understanding you should do :

for i in xrange(h):
    print(raw_input(), file=sys.stderr)
1 Like

I think I see. so the first raw_input() gives me the whole top row of all the letters+?.
next one gives the second line.
etc. up till the fifth execution which gives the fifth and final line.

I think I get how it goes then.

I always find the raw_input() thing confusing as I never know in what form the input will be given.
or I didn’t read the descriptions well enough :smiley:

That’s it :wink:

for E again : first one will give you “xxx” second one "x " third “xxx” fourth "x " and fifth “xxx”. Note that spaces are important !

Remember it’s just an example with only one letter. For the puzzle you’ll have all the letters+? on each line !

Even if you don’t undersand the description, you know that raw_input() reads a line and gives you back a string.
So I don’t get your rant :

cause currently I have o downright guess what the input will look like as the raw_input() function doesnt even tell me what the f*ck it is gonna give me, if it’s some integer, a string, an array, or something completely different?

Try this:

Take a breath.
Go to Settings, select Expert mode
Click on the buttons next to the test cases to view the inputs.

1 Like

yeah, I obviously know that. Cause I’m the fucking messiah and can read minds!

the non existent explanation of that trasdh function explained it perfectly, how could i have forgotten that? :open_mouth:
And here i was wondering what this thing does, what it takes as input and what it gives as output (and in what shape ).

In a normal program, I could use the “System.Out.println()” command (in java) to let the program simply show me the input and output of the thing and deduce what it does.
here?

well, not so much. cause print is already reserved here and i can’t generate some console text as i would love to. so I could test in between what the inpouts and putputs are and find where the error occurs.

try

System.err.println();

It is explained when you start the puzzle

// Write an action using System.out.println()
// To debug: System.err.println(“Debug messages…”);

1 Like

Where is the code… can someone help me with the code - JAVA

What is your problem ? Give us details !

1 Like

Hi. I just finished this puzzle, and got all test right except the lorem ipsum test.

I have no idea how the lorem ipsum is different from other tests.

Possible mistake in my code: I don’t put constraint in the sentence T. Then I tried to put constraint but doesn’t give any success. And it is more confusing since I don’t know what is really different from the lorem ipsum case. Thanks for the help!

Please help!
On test case 2 - MANHATTAN
No matter what I try, I can’t solve it because there seems to be some sort of character limit on my output.
Test case 1 was no problem, I made several variables such as "### " or " # " and just assembled them for each line but when I tried to do MANHATTAN I put my variables together like print(var1 + var2…) and it came out as “Nothing”. I deleted one variable off and it came out with the output I had, which was obviously wrong, but at least it was something. So I tried making a variable called “manhat” and copied the desired output. “Nothing”. I deleted the last space off of manhat and it worked- but still was wrong because it was missing the last space. So, I made mannhat = manhat + " ", and it also came back as “Nothing”. I read through the other comments before I wrote this, and noticed that someone used C and succeeded, so I think its just a language issue.
Also I don’t really understand test case 5

TLDR; There seems to be a character limit when using Python, and I’m confused as to what exactly is Test Case 5

Thanks!

Hello,
I’ve found this issue:
“EOL found” even if I removed it with rstrip(’\n’) in python… It works only on the first tests. The others write in right mode, but tests fail.
Hope to help

Hi there, i’m a beginner in coding (and more precisely in python here), for the first test case (1 letter E) I find the following result that I can’t explain :
> 12345###
> #
> ##
> #
> ###

When I get the entire string in line 1, it returns something like '12345[ # , ## , ... ]'

I looked at the notions of attribute and tried del row.attribute but it doesn’t work

If you have any advice …
Thanks in advance.

Seems you found the correct answer:

this looks like an E (and the test case name is “1 letter E”)
You just need to remove the “12345” in the front. What’s troubling you?

I can’t remove it using row.replace. As a first version for the test case 1, I used this method to get the ASCII alphabet :
j=0
___while j <=26:
___artArr1.append(row[jl:jl+l])
___row.replace(row[0:3],"")
___ j += 1

I used it for each line so I get a list artArr1, artArr2, etc… and I used print(artArr[index]) to get the previous result.

And if I print the full lists instead I still get this odd 12345 at the beginning :

12345[’ # ', '## ', ’ ## ', '## ', '### ', '### ‘, …]
[’# # ', '# # ', '# ', '# # ', '# ', '# ', '# ', '# # ‘, …]
[’### ', '## ', '# ', '# # ', '## ', '## ', '# # ‘, …]
[’# # ', '# # ', '# ', '# # ', '# ', '# ', '# # ', '# # ‘,…]
[’# # ', '## ', ’ ## ', '## ', '### ', '# ', ’ ## ', …]

Do you know how to get rid of this 12345?

try to comment parts of your code and run the test to understand where they’re coming from.

Ok thanks I found my mistake, I was getting the ASCII alphabet using this method:

for i in range(h): # pour chaque ligne (nb de ligne hauteur des lettres ASCII = h)
    row=input(i) # i = 0, 1, 2, 3, 4
    line = []
    j = 0

And somehow i was kept in memory, so when I used print() it would display 01234
Removing i from the line row=input() solve the issue, so I guess it was a pretty basic mistake : would you have any info/resource which would help me understand this?

Hello all,
i have a little problem ! i have a String ( in php ) with my word (MAHATTAN) like this:

Summary
> # # 
> ### 
> ### 
> # # 
> # # 
>  #  
> # # 
> ### 
> # # 
> # #

i don’t understand how to align each letter. This is my code

Summary

foreach( $cc as $e => $z ){ // $cc is a array of $T

        $z = strtolower( $z ); 
        
        if( array_key_exists( $z, $c ) ){ // $c is a array with alphabet (key) and ASCII (value)
            
            $chaine .= $c[$z];
        }
}

Thank you for your help !
Christophe

Hello there, I’m a bit confused on how things works here so, can someone please enlighten me on how to pass Validating tests?
I have passed all five test cases with “Manhattan”, yet after sumbit it shows that i failed at:
One Letter G
Loren Ipsum …something
full alphabet in CAPS WMADXES…
HELLO with another ASCII representation.
I tried to change input, but than it shows that i failed at test cases.