ASCII art puzzle discussion

Bonjour,

Dans ce code en C++, je parviens à afficher la lettre E mais pas en ascii art… Pourriez-vous me donner quelques conseils? Par ailleurs, à quoi servent string T, getline(cin, T), string ROW, getline(cin, ROW)?

My test cases only shows five validators, and these are:

01

Test only one letter: E

02

Test MANHATTAN

03

Test ManhAtTan

04

Test M@NH@TT@N

05

MANHATTAN with another ASCII representation.

I’m looking forward to try the “lorem ipsum” one. please let me know when you guys fix it. You’re doing a great job btw. Thank you.

Hello.

I was having trouble getting correct output for testcase " MANHATTAN with another ASCII representation" despite having correct output for all the other testcases. This is when I decided to see the input that I was getting. The following was done:

for (let i = 0; i < H; i++) {
const ROW = readline();
res = ROW.concat(res);
console.log(ROW);
}

From the above, I was expecting this output:

.----------------.
| .--------------. |
| | __ | |
| | / \ | |
| | / / \ \ | |
| | / ___ \ | |
| | / / \ \ | |
| ||| ||| |
| | | |
| ‘-------------’ |
‘----------------’

What I got instead, was this:

.----------------.
| .--------------. |


’ | | || | \ \ /
| | / / \ _ | |
| ||
| |_|| |
| | | |
| ‘--------------’ |
‘----------------’

I think this is the problem in the game. The game is not giving the right input “ROW”. I would request to kindly look at the problem.

I had issues with the output where it said found: Nothing.

I was trying to break up my outputs with multiple line writes, when the output should be a single line write.

This puzzled me for a while too.

I ended up using string.Concat() using new line characters to put each row into a single WriteLine

Hi! I’m trying to solve the portion of the problem that asks us to write MANHATTAN using another ASCII representation. When I run this program, it outputs beautifully to the console. Nevertheless, I receive an error message. Here’s what it says:

Failure
Found: .----------------. .---------…-. .----------------. .----------------. .----------------.
Expected: .----------------. .---------…-. .----------------. .----------------. .-----------------.

If you look closely, all I’m missing is a single dash in that grouping on the top line to the far right, but that doesn’t make sense to me at all, since if that’s coming from the first line of output, all the output of all letters should be identical. Not sure which alphabetic character it’s supposed to represent. If anyone knows what my issue is, I’d greatly appreciate the help!

Please someone help me with the last case.
Here is my c++ code.
https://pastebin.com/ADpFs9fW

you should read the letters from the input (ROW variable) instead of hardcoding the letters.

Thanks for the idea.

Very nice puzzle indeed. Turns out, you don’t really need all the variables given :wink:

Can’t pass Test full alphabet in CAPS WMADXESFGIJVT… in Python3. All other validators passed. Anybody got stuck as well by this validator ?

Cheers,

what is the use of string raw?

Hello,
I programmed this first in Python using a list were I stored the ASCII alphabet line by line (so I have H items in my list corresponding to the H lines in which are written the ASCII alphabet), and a string containing the regular alphabet plus the question mark.
Then I find the indexes in the alphabet-string for the character that matches the ones in the text, and print the portion of each line (item-string) of the list that coincides to each one. That’s easily done by multiplying the index of the position in the alphabet-string by the width (L) of each ASCII-Art letter, to obtain the position in the list’s item-strings. Perhaps there are other little considerations (like the character that is not in the intervals and the uppercase/lowercase letters), but that was mainly it.
The C++ version was not difficult to obtain, by applying basically the same process.

The Bash version’s ROWs are broken! :confused:

I don’t see any problem with ‘ROW’… Can you be more specific ?

1 Like

If I simply echo the ROWS in bash (like read -r ROW; echo $ROW) the output is not the same like in the description. Already letter A is missing a space from the beginning, and after B it is completely shifted.
Doing the same e.g. in C# the output matches the description.

Ah yes. ‘read’ remove trailing, leading and multiple spaces.
If you want to read the input without modification you have to use ‘IFS=’.
Same problem to display a string with trailing, leading and multiple space. Then you have to quote your variable.

for (( i=0; i<$H; i++ )); do
    IFS= read -r ROW #read
    echo "$ROW" #display
done

@TwoSteps perhaps something can be done in the stub for that ?

2 Likes

Bonjour,

J’étais en train de devenir fou avec le validateur : “Test Lorem ipsum dolor sit amet,…” qui ne passait pas pour mon code (Je code en Go), mais j’ai enfin trouvé ce qui n’allait pas.

Certains disent que c’est parce qu’il faut limiter le texte T à 199 ou 200 caractères : pas du tout !

Pour ma part je ne contrôle pas la taille de T et ça passe quand même.

Le problème venait de ma façon de lire l’entrée standard pour récupérer T. Je suppose qu’il devait lire seulement le premier mot au lieu de lire la phrase ou le texte en entier.

Mauvaise méthode :

    scanner := bufio.NewScanner(os.Stdin)
    var T string
    scanner.Scan()
    fmt.Sscan(scanner.Text(),&T) 

Bonne méthode :

    scanner := bufio.NewScanner(os.Stdin)
    var T string
    scanner.Scan()
    T = scanner.Text()

J’espère que cela vous aidera, moi ça m’a fait criser !!!

1 Like

Hello, I completed this puzzle, so if you are stuck in the “Test Lorem ipsum dolor sit amet,…” just replace the unknown characters for ‘?’, and, ignore blank spaces, so that’s all. Have a happy coding

1 Like

Edit: I had a trim on the input that was messing up with my ascii art.