Working of game : The game starts with a menu containing three options:
- Start game
- Instructions
- Exit Buttons used are to I – Up, J – left, K – down, L- Right, and S – select from menu. Start Game : We can use I, K, J , L to move snake Up , Down , left and right respectively. Food in form of ‘X’ will be generated randomly on the screen. Which can be picked by snake once the snake picks the food. It’s Speed and Score will increase. And if the snake collides with it’s body then game Ascii pattern for game exit will be displayed and as user press any key the console will exit. Instructions : Simply print the Instructions for Gameplay. Exit: Exits the game.
Complete working of code is summarized in attached word file.