Answer the question
In order to leave comments, you need to log in
Implementation of the game "Battleship" on the server side?
I want to create a game "Battleship" over the network on the site.
I decided to make logic, check on the server, and not on the client side, for security. Make 200 columns in the database table (100 columns for the 1st player's card, 100 for the 2nd). On the move, there is a request to the server, add this move to those 100 columns and return those 100 columns from the database and check if he won.
Is the implementation of this game on the server correct?
Or can it be implemented somehow more correctly, without creating these 200 columns?
Answer the question
In order to leave comments, you need to log in
I would try to get by with this structure:
Batch number | time (if needed) | move | id
123455 | 12:35:56 | b5 |
And just each time I made a selection by the number of the game and each time determined its outcome. Performance problems (if any) can be solved by caching.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question