Power Of Thor - Episode 1 - Puzzle discussion

A) Probability that the easiest challenge of CG that has been successfully completed by thousands of coders has a bug: 0.0001 %.

B) Probability that your code has a bug: 99.9999 %.

Hint: this problem is so easily solved that some people can solve it in just 46 characters (for the record, your message is more than x4 longer).

Soluce: change any a - b formula into your code into b - a until Firefox stop crashing.

Hi

I got : Expected a movement (one of N, NE, E, SE, S, SW, W, NW) but found ‘E’
And that’s mindfuck

I guess you are either missing a newline or you are printing a “not printable” character.

Well I used char. I solved it by using string :slight_smile:

This is my code :smile:
First time so i have complexity code :smiley:

[EDIT: NO FULL CODE]

It’s worked for 4 cases :smiley:

When one see a posted code, one needs to count the minutes until its author get striked by the Lighting of Moderation. The distance of  the moderator to its desk could then be derived by the mean of a simple division.

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.