ASCII art puzzle discussion

Hey ! Just expose your problem, and if somebody can help you, he will.

I’ve the same problem. Anyway I do not understand the test. If someone can explain me ?

the test @MikaPern @Xispa

Input

4
5
WMADXESFGIJVTHKNOBPLYQRUZC
 #  ##   ## ##  ### ###  ## # # ###  ## # # #   # # ###  #  ##   #  ##   ## ### # # # # # # # # # # ### ### 
# # # # #   # # #   #   #   # #  #    # # # #   ### # # # # # # # # # # #    #  # # # # # # # # # #   #   # 
### ##  #   # # ##  ##  # # ###  #    # ##  #   ### # # # # ##  # # ##   #   #  # # # # ###  #   #   #   ## 
# # # # #   # # #   #   # # # #  #  # # # # #   # # # # # # #    ## # #   #  #  # # # # ### # #  #  #       
# # ##   ## ##  ### #    ## # # ###  #  # # ### # # # #  #  #     # # # ##   #  ###  #  # # # #  #  ###  #  

Output

# # # #  #  ##  # # ###  ## ###  ## ###  ## # # ### # # # # ###  #  ##  ##  #   # #  #  ##  # # ###  ## 
# # ### # # # # # # #   #   #   #    #    # # #  #  # # # # # # # # # # # # #   # # # # # # # #   # #   
### ### ### # #  #  ##   #  ##  # #  #    # # #  #  ### ##  # # # # ##  ##  #    #  # # ##  # #  #  #   
### # # # # # # # # #     # #   # #  #  # # # #  #  # # # # # # # # # # #   #    #   ## # # # # #   #   
# # # # # # ##  # # ### ##  #    ## ###  #   #   #  # # # # # #  #  ##  #   ###  #    # # # ### ###  ##
2 Likes

thanks !!!

bonjour est ce que vous m aideriez avec ce code, je débute en python et ça fait trÚs longtemps que j ai pas codé en c ou c++ :frowning:

Hey ! Can you please post in English ? And if you need some help just expose your problem.

1 Like

Hi diliscia,
I’ve done the same approach, but my problem is each portion that matched character index in T string ( i.e ROW.substring(index4, (index4) + 4) can’t be stored properly in either String, String array, or even a StringBuilder when having multiple letters in T String!
Even when try to print portion by portion the substring from ROW I got missed up output!

Could you please help me out! I’m using java.

This ‘Lorem ipsum’ text contains spaces, be sure that you reading whole line but not just first word.

The results page is saying my code fails validator 6 even though when I test the validator by myself, assuming the order is WMADXESFGIJVTHKNOBPLYQRUCZ or WMADXESFGIJVTHKNOBPLYQRUZC. It works when I run it through the IDE, but the validator says it’s failing. I’m not sure if this is the right spot to bring this up but I dont known where else to.

Validators are different from the tests, but equivalent. So passing the test in the IDE does not mean you will pass the corresponding validator.

I did it in typescript and php
1rst submit didn’t pass few tests (4-5 if i remember well)
It was because i didn’t read the instructions thoroughly
 and i treated only @ as ?
Just had to change that for any character not a-z or A-Z and all validated

Just split the string and match a-zA-Z with their ascii art, anything else is the 27th ASCIIart character, which is a “?”

From there it should be good

1 Like

My program works fine in my IDE, but when I enter it into the site and attempt to run any of the tests I get:

Console output

Errors

Segmentation fault.

Failure

Found:
Nothing
Expected:

I’m still fairly new to this so any guidance would be appreciated.

I dont understand too, WTF validator “5 Test Lorem ipsum dolor sit amet,
”.
I see testcase #5 “MANHATTAN with another ASCII representation”, and its successfully passed.

There should be something done to remove or change the “Lorem ipsum dolor sit amet,
” to be more validator friendly.

Me and my friend did this puzzle, I failed and he didn’t fail the 5th validator the only difference between us is I use a constant string “ABCDEFGHIJKLMNOPQRSTUVWXYZ?” to get the # of the letter, while he use the ASCII values of the characters to calculate their position.

It looks as if people’s code couldn’t work with spaces.

@MiguelNLopez sorry about the late reply. It seems you don’t handle the ‘Z’ letter properly

@Rebornsol I’m sorry, unfortunately, we have an issue with getting the stack trace of segmentation faults on solo puzzles. Since it’s working in your IDE, it might be related to the way you read the inputs. Unfortunately, my C/C++ knowledge is very low. Anyone willing to help?

@polill00 you’re right, we should improve the IDE test cases which seem sub-par compared to other puzzles. I’ll look into it. Thanks!

1 Like

Hey all, i’ve been failing validation tests AB!!CD and Lorem Ipsum in JS and i do not know why (i’ve tested with a handwritten lorem ipsum string, and it did output LOREM?IPSUM etc
 however when testing AB!!CD i get AB?CD) .

Right now i create a dictionary which contains all letters and ? symbol, and attribute to each their ASCII representation as given in ROW (every letter gets its current row representation , eg a:" # ").
I then store the formatted version of T, which replaced all non [a-z][A-Z] characters by “?”. I use a regex with .replace() for that :

  let thisWord = T.toUpperCase();
  let replacedWord = thisWord.replace(/([^a-zA-Z])+/g, "?");

I then iterate T and fetch the letter’s values in the dict, and output the concatenation of all letters.
Could anyone look at my code and give me hints ? I’m a beginner in JS, so any help is appreciated .

EDIT : Well, i’m an idiot. The regex + was at fault. Now 100% !

the 7th test have some problem

Nope. It does not.

Continuing the discussion from ASCII art puzzle discussion:

Bonjour Ă  tous,
Je me permets de poster encore un message ici Ă  propos de ce puzzle. J’ai rĂ©ussi Ă  90%, mais les tests se plantent sur le “Lorem Ipsum
”. J’ai pourtant bien gĂ©rĂ© les espaces et les caractĂšres spĂ©ciaux, mais rien n’y fait. J’ai fait un test hors CodinGame et ça marche. En tout cas, je ne vois pas d’erreur. Du coup, je ne sais pas quoi faire parce que je ne sais pas ce qu’ils attendent comme rĂ©sultat.
De plus, je n’ai pas accùs aux solutions, ce que trouve franchement dommage, surtout quand on a fait 90%

Est-ce que quelqu’un aurait une idĂ©e ?

It seems your code doesn’t handle well the last row, I don’t know why. Here’s the Lorem Ipsum validator for you to double check:

Input:

4
5
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor.
 #  ##   ## ##  ### ###  ## # # ###  ## # # #   # # ###  #  ##   #  ##   ## ### # # # # # # # # # # ### ### 
# # # # #   # # #   #   #   # #  #    # # # #   ### # # # # # # # # # # #    #  # # # # # # # # # #   #   # 
### ##  #   # # ##  ##  # # ###  #    # ##  #   ### # # # # ##  # # ##   #   #  # # # # ###  #   #   #   ## 
# # # # #   # # #   #   # # # #  #  # # # # #   # # # # # # #    ## # #   #  #  # # # # ### # #  #  #       
# # ##   ## ##  ### #    ## # # ###  #  # # ### # # # #  #  #     # # # ##   #  ###  #  # # # #  #  ###  #  

Output

#    #  ##  ### # # ### ### ##   ## # # # # ### ##   #  #    #  ##  ###  ## ### ### ###  #  # # ### ### ### ###  ##  #  ###  ## ###  ## ### ### ### # # ##  ###  #  ##  ### ##  ###  ##  ## ### ###  ## ### ### #   ### ### ### ###  ## ### ##  ### ###  #  ### ### ##  ###  ## # #  ## ### ###  ## # #  ## ##  ### ### ##  ###  ##  ## ### ### #   ###  ## ### # #  ## ### ###  #  ##  ###  #  ##  ### ### ##  ###  ## ### ###  ##  ## ### # # ###  ## ### ### ###  #  # # ### ### ### ###  #  ##  ### ##  ###  ##  ## ### ###  ## ### ### ###  ## ### ### # # #   ### ##  ###  ## ### ###  ## ###  ## ### ##  ### ### ##   #  #    #  ##  ### 
#   # # # # #   ###   #  #  # # #   # # ###   # # # # # #   # # # #   # #    #   #    # # # ### #    #    #   # #   # # # # #   #   #    #  #    #  # # # #   # # # # #  #  # #  #  #   #    #  # # #     # #   #    #   #    #   # #   #   # #   # # # # # # #   # # #  #  #   # # #     #   # #   # # #   # # #   # # # #  #  #   #   #     # #   #   #    #  # # #     #  #  # # # #  #  # # # #   #   # # #  #  #   # #  #  #   #    #  ###   # #    #   #    # # # ### #    #    #   # # # # #  #  # #  #  #   #    #  # # #     # # # #   #     #   # # # #    #  # #  #  #    #  #   #     # #   #   # #   #   # # # # # #   # # # #   # 
#   # # ##  ##  ###  ##  #  ##   #  # # ###  ## # # # # #   # # ##   ##  #   #   #   ## ### ### ##   #   ##  ## #   # # # #  #  ##  #    #  ##   #  # # ##   ## ### # #  #  ##   #   #  #    #  # # # #  ## ##  #    #   #   ##  ##  #  ##  # #  ## # # # # # #  ## ##   #   #  # #  #   ##  ##  #  # #  #  ##  ##  # # # #  #   #   #  ##   ## #   ##  #    #  # #  #   ##  #  # # ##   #  # # ##   ##  ## # #  #  # # # #  #   #   #   #  ###  ##  #   #   #   ## ### ### ##   #   ##  ## ### # #  #  ##   #   #  #    #  # # # #  ## # # ##  #    ##  ## # # #    #  ##   #  #    #  ##   #   ##  #  ##  # #  ##  ## # # # # #   # # ##   ## 
#   # # # # #   # #      #  #     # # # # #     # # # # #   # # # #       #  #   #      # # # # #    #          #   # # # #   # #   #    #  #    #  # # # #     # # # #  #  #    #    # #    #  # # # #     #   #    #   #            # #   # #     # # # # # #     # #  #    # # #   #           # # #   # #   #   # # # #  #    #   # #       #   #   #    #  # #   #      #  # # # #  #  # # # #         # #  #  # # # #  #    #   #  #  # #       #  #   #      # # # # #    #          # # # #  #  #    #    # #    #  # # # #     # # #   #           # # #    #  # #  #  #    #  #     #       # #   # #         # # # # #   # # # #     
###  #  # # ### # #  #  ### #   ##  ### # #  #  ##   #  ###  #  # #  #  ##  ###  #   #  # # # # ###  #   #   #   ##  #  # # ##  ###  ##  #  ###  #  ### # #  #  # # ##  ### #   ### ##   ## ### # #  ##  #  ### ### ###  #   #   #  ##  ### ##   #  # #  #  # #  #  # # ### ##  ### ##   #   #  ##  ### ##  #   ### # # ##  ### ##  ##  ###  #  ### ###  ##  #  ### ##   #   #   #  # #  #   #  # #  #   #  ##  ###  ## # # ### ##  ##  ### # #  #  ##  ###  #   #  # # # # ###  #   #   #  # # ##  ### #   ### ##   ## ### # #  ##  #  # # ###  ##  #   #  ### ###  #  # # ###  ## ### ### ##   #  ##  ### ##   #   #  ##   #  ###  #  # #  #
1 Like