Winning at Snake!


#1

I watched the whole thing…twice! :snake:


#2

Bloody 'ell… that was intense!


#3

Seeing the “player” source code…or if that was actually played by a real human. Both would be equally fascinating

  • Carl Sagan 2017

#4

Seems to me that an easy way to code it up would be to focus on the movement of the snake to maximize collision with itself. You could probably ignore the actual food bits as long as the movement pattern would eventually hit all the squares.

Reminds me of this for some reason:


#5

I agree that would be my first attempt at this, the video however seems to show the snake targeting the dot at least at the beginning, I would think an obvious visual pattern would begin if avoiding self, but I could be wrong about that

I am unable to comprehend the link you posted due to an experiment I’ve been running on alcohol, I’m going to take a second look in my morning but I felt the need to post this now. My unrelated experiment is also related to some recent posts, so sorry about that everyone


#6

I would start from the end and calculate toward the beginning, record it and then reverse the timescale to make it look awesome.

I assume all solutions that fill the entire area are solvable? The snake would be shorter and shorter in a reversed timescale.

Edit: the forward solution would be to only let the snake follow the path of an solution that covers the entire area. So at each set of paths/timeframes, the snake always follow the path of a known full area solution. (Ah, I see Krilnon proposed the very same solution :slight_smile: )


#7

Some simple statements, pointing out the obvious for a snake motion to have a full solution.

-The product of the grids base and height has to be even.
-The sum of all motion is zero.
-The number of moves equal grid size.
-Each point on surface has two connections.

Anything else?


#8

I thought I didn’t agree with you at first, but I think you’re saying if you ran this pattern, starting as the smallest snake size, it will eventually grow to full size while never hitting itself. I suppose that does work

…(smashes 2001 Nokia phone)


#9

Sure. The problem is easily solved.

if the snake always runs the same path…, :smile: … eh, it will always succed… so naturally, if the snake alternates between known solutions(if possible), it will only look random, but in fact be very determined.

What i really want to know, is if there is something behind krilnons hunch? I think there is, but I can’t figure out what it is? I thought I had it if the snake reached half maximum length, ie, a diagonal of sort, and the rest of the motion would be known, but no…


#10

But still, the video looks as if the snake is targeting the dot, so at least something different is happening there.


#11

Yes, but only while snake length seems smaller than half maximum length. After that, it all turns “tactical”


#12

Hmm, so, I think you want to follow a path like this… a nested spiral:

Then you use up the maximum size of the board just as you reach the starting position. I haven’t tried it, but I assume the introduction of food doesn’t really matter following this path.