DEV Community

Discussion on: Snake...in pure HTML⁉️ [no JS, no CSS, no images!!] 😱

Collapse
 
realjoshbyrnes profile image
Josh Byrnes

This is quite impressive. I'm really surprised you didn't use cookies and keep the session management in PHP - This would have ensured users can't cheat (lol) and it would also fix your URL length issue.

It works reasonable well, although the latency is a bit of a pain (game works quickly sometimes, other times not so quickly). This is probably as I'm in Australia.

Because you've kept the PHP stateless, it would probably work quite well in a FaaS environment.

Collapse
 
grahamthedev profile image
GrahamTheDev

Latency to Australia will certainly make the game slower and less consistent lol!

The reason state is in the URL is because originally I was going to just do this as a series of static files, but then did the calculation on the number of files required.

You are right, we could certainly do it in cookies now that it has a backend, I was trying to keep it as close as possible to HTML only as possible! 💗