Maze Mapping API-Robot

Back to General discussions forum

CSFPython     2024-10-21 18:38:05

I have had a look at this problem but cannot seem to get it to work. After sending the token, the lines of text are received quite correctly. After that, sending the token followed by a command (on a new line) only succeeds in resetting the problem. The data received indicates a new problem, with steps set to 0, (x,y) unchanged and sometimes a different set of exits (as we might expect from a new problem).

I am using the same code that I used with the Mad Beaver problem earlier, so I am not sure what it is that is going wrong.

On another point, I am very surpised at the small size of the problem. This seems to be 6 x 6. The diagram given with the problem description is 13 x 13 and I had expected the actual problem to be at least this big; probably bigger. If you are thinking about move limits I think that it should be possible to identify the full maze in 4 moves per square of the maze, so 144 moves for 6 x 6 or 676 for 13^2; unless the maze is contrived to be really awkward in this respect. By moves I assume that forward, left and right would each be counted as 1 move.

On another very minor point, there are two examples of 7 x 7 mazes in the problem description. The first of these is invalid because it contains two adjacent squares which are contradictory. The error is at position (2,2). The correct matrix is 46aaec4-7d2ad15-516efad-785152d-7c38785-5786bc1-1383838.

Rodion (admin)     2024-10-21 20:29:21
User avatar

Clive, Hi! Perhaps there could be issue with auto-detecting input format. There is something in instruction about it, but it may be clumsily expressed or outdated. In short, it would be good to add a "header" to the request, specifying incoming data format:

`Content-Type: text/plain`

I regretfully am not sure how this is done in Python 2.x, but judging by manual it shoud be enough to add the fourth parameter to the request function, perhaps as a dict, e.g. {"Content-type": "text/plain"}.

Not sure why it works (worked?) with beaver but don't work now. I'll go and try some testing myself...

As of the size of the maze - let's increase it. The issue is I haven't tested our "games" yet with significant number of requests. Well, we'll test then :)

Thanks for the correction to the example. Let me see that my code for producing "map" is not buggy...

UPD: I tried to test it without passing the header and it seems "format autodetection" works fine still. Though I observed the behavior you report when I mistyped the string (so that actually there was not cmd key, but some malformed.

CSFPython     2024-10-22 11:49:55

Rodion,

Thanks for your suggestion. This wasn't the problem. The problem was that I was confused by your problem description. The example given for sending a command is:

token=blahblahblahblah
cmd=forward

I used this syntax in my code. The token was accepted but not the command. Finally I decided to replace the = with a colon and a space character, which was the syntax in Mad Beaver. This means that I now entered:

token: blahblahblahblah
cmd: forward

Maybe this is just me being a bit stupid but I do think that the = syntax should be removed from the problem description in case anyone else is fooled by it.

Having made this essential substitution my program is now accepted. It is curious that the token was accepted with the wrong syntax. If the token had not been accepted I might have resolved the problem a lot sooner.

Rodion (admin)     2024-10-23 20:56:01
User avatar

Dear Clive!

Thanks, I'm obviously confused two formats in the example, making some mix of them. I'm much sorry for this confusion. Also it is always so very impressive how gently you point out my stupid mistakes, blaming instead yourself :) You know I (most probably not only I) always believe your sharpness of mind is truly unparalleled!

gardengnome     2024-10-29 06:13:04
User avatar

Fun little task, thank you.

gardengnome     2024-10-29 07:15:39
User avatar
'end': 'game is lost', 
'msg': 'expected:42c444442c444-5455795569555-3bd3f857b6b95-...`

Let's take a look at the third row 3bd3f857b6b95, in particular the substring b6:

  • b = 1011
  • 6 = 0110

The b indicates there is a passage eastwards as the second bit is set, but the 6 indicates that there is no passage westwards as the forth bit is not set. That's a contradiction assuming passages are bidirectional - bug?!

50%+ of attempts lead to small errors like that in my testing.

Please login and solve 5 problems to be able to post at forum