Desired result:
- Develop simple UI interface for the minesweeper game
- Solve levels and (?) find 4 passwords
Game UI requirements:
- Backend located at
wss://hometask.eg1236.com/game1/
- API documentation available via request 'help' to the backend ws endpoint
- UI application should keep connection during user game session
- Game has 4 levels
- Level board dimension is not static
Solving the levels:
- It is allowed to use minesweeper solving algorithm
API:
help
Message from server
help - returns valid commands
new L - starts new session, L=1|2|3|4
map - returns the current map
open X Y - opens cell at X,Y coordinates
new 1
, new 2
, new 3
, new 4
Valid command
new: OK
Invalid command
Unknown command. Send 'help' to view documentation.
map
Level is not set
map: Not started
Level is set
map:
□□□□□□□□□□
□□□□□□□□□□
□□□□□□□□□□
□□□□□□□□□□
□□□□□□□□□□
□□□□□□□□□□
□□□□□□□□□□
□□□□□□□□□□
□□□□□□□□□□
□□□□□□□□□□
User lost
map:
1*□□□□□□□□
112□□□□□□□
00111112□□
00000001□□
00001111□□
00112□□□□□
012□□□□□□□
01□□□□□□□□
02□□□□□□□□
01□□□□□□□□
open X Y
Note: coordinate origin is in the top left corner
Level is not set
open: Not started
Valid X
, Y
open: OK
Invalid X
, Y
open: Out of bounds
Open X
, Y
with bomb cell
open: You lose
Open X
, Y
resolves the game
open: You win. The password for this level is: ThisWasEasy
Unknown command
Unknown command. Send 'help' to view documentation.