Question: Write a Java program to design Snake game. With every 5 steps, the snake will grow by 1.Consider the following in the code: 1] Code
Write a Java program to design Snake game. With every 5 steps, the snake will grow by 1.Consider the following in the code:
1] Code a service that runs a game of snake, 2 methods: moveSnake(direction) and isGameOver()
2] if the Snake goes out of the boundary it should wrap in from the opposite side of the screen.
3] Optimise the code using deque
4] How would you take care of concurrent button presses, i.e if someone presses up and right at the same time
5] Use a design pattern
6] Write unit tests to check the solution
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
