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
help :D:D
Is “NW” possible?
I’m stuck. Can somebody help me? I’m not very good at this.
We can help you but you should give hints about your difficulties (but not your full code).
bug??
[EDIT: NO FULL CODE]
it will fail in the case 3&4
it cout SE even in the Thor position = (17,17). Light position = (36,17)
You don’t update Thors position. Inside your loop initialTX
and initialTY
are always the same.
I’m almost there, but I don’t fully understand the last part of the pesudocode. " Indicate, before the end of the turn, the chosen direction as the concatenation of directionY and directionX."
[EDIT: NO FULL CODE]
I know I’m suppose to determine the direction, here. Can anyone give me hints?
Dear anyone, I would really could use some help.
I’m typing in C++
I’m trying to follow the Pseudo Code as much as possible.
I wish I could post my code here, but everytime I do, it gets edited/removed.
The last part of the pseudo code is “Indicate, before the end of the turn, the chosen direction as the concatenation of directionY and directionX.” which I don’t fully understand.
I know it’s suppose to interlock/work together, with North and South and East and West.
I feel like I’m so close, but just a hair off. Can someone please help me please.
You have to concatenate the two strings and a linebreak, and then use printf
to output the result.
In C++ you can aslo output your response like this
cout << dir1 << dir2 << endl;
dir1 and dir2 can be string, char* or char.
how?? can you tell me the logic??
I need help, dont know how to pass ‘Easy and Optimal angle’ ? This is my code in PHP:
[EDIT: NO FULL CODE]
To make it in time Thor has to move diagonally (NE NW SE SW). Your code doesn’t allow that. Also, you have to update Thors position.