Power Of Thor - Episode 1 - Puzzle discussion

yeah! my code here ASCII art puzzle discussion holds 29k minutes

Seems like we missed something.
But yeah, the GHOM* striked again.

*The ‘Greath Hammer of Moderation’ was designed by Thor, so that we could apply Justice on the forum.

In part 1 and 2 (Straight line and Up), I get: Expected a movement (one of N, NE, E, SE, S, SW, W, NW) but found ‘E’
In part 3 and 4 it works until Thor has to move horizontaly or vertically, then he moves off the map.
What should I do?

Already asked 7 posts above and, without surprise, the answer didn’t changed: ‘E’ is the textual representation of a character (1 letter + 2 simple quotes), not the output of a string of one letter.

I’m working in Python 3 and I’m having problems with the print function.

From what I can tell by testing my code, all of it is functional, except I cannot work out how to concatenate the two strings I need to print out (the direction_x and direction_y values). When I write only [print(direction_x)] as the last line, it works for the first test - unsurprisingly, as that one does not require a movement on the y-axis - but obviously that’s not going to work for all of them. I tried [print(direction_x, direction_y)] thinking that would solve the problem, but to no avail. Thor only stands motionless and watches the world burn.

Bonjour
en C je ne sais pas comment afficher une variable pour debug. Par exemple la variable initialTY.
fprintf(stderr, “Debug messages…\n” );
???

Hello
In C I don’t know how to display a variable for debug. Eg initialTY variable.
fprintf(stderr, “Debug messages…\n” );
???

Idem python3

The right line isn’t the template?

try:
  from sys import stderr
  print(blabla,file=stderr)
except SyntaxError:
  print("Damnit")

Hi! Please tell me, my code works for 1 and 3 parts (Power of Thor), but for 2 and 4 it does not work. He is going a long way and he did not have enough energy.
part of the code:

    string directionX = System.String.Empty;
    string directionY = System.String.Empty;
    
    if (thorX >= lightX) {
        thorX=thorX +1;
        directionX = "W";
    }
    else if (thorX <= lightX){
        thorX=thorX -1;
        directionX = "E";
    }

    string next;
    next = string.Concat(directionY, directionX);
    Console.WriteLine(next);


    Thank you!

What if thorX==lightX?

hi,
This is answer for my question? But perhaps I understand you.
Thanks

Hello
precisely in python it is proposed the next line.
    print(“Debug messages…”, file=sys.stderr)

But if I want to know, for example the value of the variable : thor_y

https://docs.python.org/3/library/functions.html#print

The first argument is an object, so you can write a message like “Debug messages…” or send a variable like thor_y.

In this case the precise print is dedicated to thor movement.
I ask print(thor_y)
He respond
Expected a movement (one of N, NE, E, SE, S, SW, W, NW) but found ‘5’

Have you read the link given by @yohannjardin?

I just got it.
The syntax is:
print (“Debug messages …”, thor_y, file = sys.stderr)

Thank you

As I said, you can write something else than “Debug messages…”
Hence, the following is also valid:

print(thor_y, file=sys.stderr)

if TX > LX :
    [NO FULL CODE]
    elif TX < LX :
    [NO FULL CODE]
    elif TY > LY:
    [NO FULL CODE]

for 1 2 and 3 the code is ok but the 4 not :frowning:
help :D:D

1 Like

Is “NW” possible?