ASCII art puzzle discussion


#422

or you have an issue in your code when you insert an integer in the middle :slight_smile:

cout << offset;


#423

Hi Thibaud,

First of all, thanks for the answer.

But I don’t understand.
On the screenshot, you can look at my code on the right.
I do not insert anything, I just print the input.

Sorry if I’m missing your point.


#424

I can’t see much on your screenshot :wink:

I just tried outputting the input and got it right. Moreover, if I remove the line where you print the offset variable in your code, I get no issue.


#425

Ok… I’m just dumb af XD

And now I understand your first message. I didn’t know you could see my code.

Sorry for bothering you for such a silly mistake.

Thanks!


#426

I had problem with the Lorem ipsum test in Lua.

To solve it I used the function string:gsub() and the necessary character class. In this case the %p & %s classes.

I would read the T string via the gsub function and that way replace all the “unknown” characters with “?”.


#427

I’m trying to do this puzzle in Python3.
I’m confused about the output string. Regardless the algorythm, even if I print a static string (for the first excercise with letter ‘E’) I get odd feedback.

Example 1
If I print static:
print("### ")
I get:
Found: Nothing
Expected: "### "

Example 2
If I print static:
print("### \0")
I get:
Found: "### "
Expected: "### "

Why on earth should I use ‘\0’ in Python? Why is the result still incorrect?


#428

You are expected to print more than 1 line. The “Found: Nothing” refers to the missing 2nd line.


#430

have you mantioned space in your program, because lot of languages skip space as it is not needed. Also look through every signs like: !., ? and so one.
Hope it will be helpful!
Sincerely Boolmachine.


#431

Hello,
Does someone know why I have a memory issue using this:

int main()
{
int L;
cin >> L; cin.ignore();
int H;
cin >> H; cin.ignore();
string T;
getline(cin, T);
int row = H - 1;
int counter = 0;
string art_array[row][26];
for(int i=0; i < H; i++) // going down the array
{
string ROW;
getline(cin, ROW);
for(int j=0; j < 26; j++) // going along the array
{
art_array[i][j] = ROW.substr(j*L, L);
std::cout << art_array[i][j] << std::endl;
}
}
}


#432

Oh yeah easy. You say art_array[H-1][26]
but then you make i goes from 0 to H-1, instead H-2


#433

Oh yeah I see it know thank you very much


#434
for (int i = 0; i < H; i++) {
    char ROW[1025];
    fgets(ROW, 1025, stdin);
    printf("%s",ROW);
 
}

Comment est ce que ce code renvoie toute les lettres avec # caracteres… Je ne comprend vraiment rien à cet exercice… quelqu’un peut il me mettre sur la voie ?


#435

Hello bro I am new to coding… I am using cpp language. I am not able to understand how to do this question. Can you please help me?


#437

I don’t understand how I’m failing the Lorem ipsum validation test…


#438

Something I said on discord as the above case was brought up which might be help to others in the future: Be careful of using regex, since cases might have punctuation marks like periods, and you could guess what /./i does~


#439

[English]
Hello. I’m trying to solve this “panel” problem. I don’t think I understood the concept of this exercise.
I created an alphabet using the character “#” as a “led” of the panel. My code passes in 4/5 initial tests. The fifth test shows a new representation of the alphabet (which was not in the instructions of this exercise). So I think I should create another alphabet that depends on the sizes read in the input? I really don’t know what to do…

[Português]
Olá. Estou tentando resolver o problema do “painel de aeroporto”. E não sei se entendi bem o problema a ser solucionado.
Eu criei um alfabeto com as letras usando # para representar os “pixels” do painel. O meu código passou em 4/5 testes. O quinto teste mostra uma nova representação… Então eu tenho que usar um novo alfabeto a depender do tamanho dado na entrada do programa?


#440

Well the input is clear :
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 you definitely need to read the inputs to know how each lettter is represented. Do not hardcode an alphabet


#441

one of the tests contains a “?” as input character.
this is not part of your lookup string “t”

unsure whether that is the bug or not, but it’s easily overlooked since the description is not clear about this.


#442

Return value for .search is -1 when it’s not in the string.


#443

Franchement je passe plus de temps à comprendre le fonctionnement de vos entrées/sorties que de trouver l’algo… je trouve que c’est un peu dommage pour quelque chose qui se veut un jeu intuitif…