I think Websocket is not really necessary for that, it could be implemented without "active" connection. For example we could store a timestamp for each guess and calculate the difference between the…
It could be solved with a hidden element, for example with class hidden
which can be removed by JavaScript when it should be shown (it still can have class hideOnNarrowScreen
). But I think it is…
I think some of the rules should be handled on higher level, for example font-family
in mapguesser.css line 34,
This highscore table could be implemented for multiplayer in the future.
So actually users can cheat with this if they send a bigger number back :D
This file should be refactored sometime because it is very spaghetti :D
I think rand() should be called with explicit arguments, otherwise a number is returned between 0 and getrandmax() and getrandmax() is platform-dependent.
Maybe a do..while would be better here because the token calculation should not be repeated.