There is no Spoon - Episode 1 puzzle discussion

I see no problem with that input.

ok okā€¦ I find my faultā€¦ :slight_smile:

u have me missed of some different testcase other than mentioned in problem.

hi guys,
i think this puzzle is bug.
Why under Visual studio 2015 all case work and not with this compiler?

I donā€™t understand how the output should look like.
My code outputs one line per node, line looks like this for example:

0 1 -1 -1 -1 -1

The lines are printed out one by one. The game says:
Timeout: the program did not provide 1 input lines in due timeā€¦

2 Likes

What are the keys to use? Do you know or anybody else that does either ?

I am new at coding. I just had one question. Donā€™t understand how the inputs are put in. I know that they are coordinates according to the grid, I think. I just donā€™t know how to make them work with one another. I am using JAVA SCRIPT if anyone would kindly give me tips. I am honestly not looking to complete the puzzle just yet. I just need to work towards it.

First off, itā€™s the width and height in two rows. That partā€™s filled in for you already.

5
3

The data itself is a matrix of .'s a 0ā€™s that will look something like this:

000.0
.0.0.
0...0

The coordinates are the position in the matrix, where (0,0) is the top left position.

What data type is best to use for storing the input? If I use int, the .'s throw me off. If I use char, I get weird data stored in my array.

Iā€™m trying to solve this in Java, but Iā€™m failing the horizontal (and square) tests. The output I get is:
Standard Error Stream:
height=3,i=0: line = 0.0
height=3,i=1: line = ā€¦
height=3,i=2: line = 0.0
Standard Output Stream:
0 0 -1 -1 -1 -1
Game information:
(-1, -1) is not to the right of (0, 0). Expected (2, 0).

It seems to me that the right-hand neighbor of (0,0) doesnā€™t exist (the value is ā€˜.ā€™). I donā€™t see why the correct answer would be (2,0). Can someone explain that to me? (My vertical tests succeeded).

Oh, I get it. I just read carefully through the instructions again.

you missed the <<endl after 6 integers ( i have to put << endl after only 6 integers)

Why does this puzzle has Lists (and only Lists) specified in itā€™s tags?
Seems kinda random to me. Am I the only one who cannot see an obvious solution involving lists?
(other than, you know, the fact that a 2D array can technically be described as a list of lists)

because the next doesnā€™t really mean the ā€œnextā€, more like the next node.

Hello, I got stuck on the diagonal test of the puzzle. I have an algorithm that after finding the node, it searches the next neighbour node, and if it doesnt find any, (for example, while searching the closest right neighbour, searching ends at when it reaches the value width value) stops and writes ā€œ-1 -1ā€. However this algorithim doesnt work for diagonal. Thank you in advance.

Okay - I am a beginner.
I am trying to print debugging messages in Python, but the program errors saying "invalid input. Expected ā€˜x1 y1 x2 y2 x3 y3ā€™ but found ā€˜Debug messagesā€¦ 2 2ā€™ and it never gets past the first print message. I have done used the print function to debug on the other beginner programs with no issues.

Try adding a call to sys.stderr.flush() after your debug print calls.

  • danBhentschel

Thank you for the ideaā€¦but I still only get the first print line and nothing else.

Mp your code so I can quickly look into it.

Sample Code

just to note - this is just me trying to get something to print.