Embed presentation
Download to read offline
![Write a Java console program to design the Snake game.. Do not use Swing/Applet or any UI
components. This is a java console application. Simulate the game run through the main and
write unit tests as well. Consider the following in the code:
READ THE BELOW INSTRUCTION : INCOMPLETE/ HALF CODE WILL BE
DOWNVOTED
Modularise the code. The code should be a working solution. Do not provide half a solution.
Please make sure the entire code is visible in the post and not just a part of the code. The code is
executing without any compiler errors. Include the screenshot of the execution. Otherwise, I will
downvote. Share the screenshot of the runs and the Junits passing.
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] With every 5 steps, the snake will grow by 1
4] Optimise the code using deque
45 How would you take care of concurrent button presses, i.e if someone presses up and right at
the same time
6] Use a suitable design pattern and explain why you have used it.
7] Write unit tests to check the solution and show the screenshot of the Junit Test run.An
incomplete or failing tests will be downvoted.
MISSING ANY OF THR ABOVE REQUIREMENTS WILL GET A DOWN VOTE /DISLIKE](https://image.slidesharecdn.com/writeajavaconsoleprogramtodesignthesnakegame-230329152632-9d0abd30/85/Write-a-Java-console-program-to-design-the-Snake-game-Do-not-use-S-pdf-1-320.jpg)
The document provides instructions for developing a console-based Snake game in Java, emphasizing that no UI components should be used. It outlines specific requirements including complete code visibility, game mechanics like snake movement and growth, and handling edge cases like boundary wrapping and concurrent inputs. Additionally, it mandates the inclusion of unit tests and execution screenshots to verify the solution's correctness.
![Write a Java console program to design the Snake game.. Do not use Swing/Applet or any UI
components. This is a java console application. Simulate the game run through the main and
write unit tests as well. Consider the following in the code:
READ THE BELOW INSTRUCTION : INCOMPLETE/ HALF CODE WILL BE
DOWNVOTED
Modularise the code. The code should be a working solution. Do not provide half a solution.
Please make sure the entire code is visible in the post and not just a part of the code. The code is
executing without any compiler errors. Include the screenshot of the execution. Otherwise, I will
downvote. Share the screenshot of the runs and the Junits passing.
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] With every 5 steps, the snake will grow by 1
4] Optimise the code using deque
45 How would you take care of concurrent button presses, i.e if someone presses up and right at
the same time
6] Use a suitable design pattern and explain why you have used it.
7] Write unit tests to check the solution and show the screenshot of the Junit Test run.An
incomplete or failing tests will be downvoted.
MISSING ANY OF THR ABOVE REQUIREMENTS WILL GET A DOWN VOTE /DISLIKE](https://image.slidesharecdn.com/writeajavaconsoleprogramtodesignthesnakegame-230329152632-9d0abd30/85/Write-a-Java-console-program-to-design-the-Snake-game-Do-not-use-S-pdf-1-320.jpg)