The "snake" command will initiate a terminal-based rendition of the classic Snake game. Players will maneuver the snake using keyboard controls, guiding it to consume food and grow while steering clear of collisions with both the walls and the snake’s body.
Plan:
- Implementation:
The snake command will render a text-based version of the Snake game in the terminal, displaying the snake, food, and boundaries. The snake will be controlled by the arrow keys or something else if necessary, with food appearing randomly on the grid. The snake will move at a constant speed, and the game ends when it crashes into either the walls or itself.
- Key Input:
Players will control the snake’s direction using the keyboard (up, down, left, right). Ensuring the operating system can handle real-time keypresses for arrow keys is crucial, with fallback options for alternative key controls if the OS doesn’t support arrow key input.
- Game Logic:
The game continues until the snake hits the walls or itself, with the current score displayed in the terminal. After a game over, the game will automatically reset.
Files to be Added/Modified:
user/snake.c: Implement the Snake game logic, including handling movement, collision detection, and difficulty settings.
Makefile: Update to compile snake.c along with other OS commands.
kernel/syscall.h: Verify the system calls that handle real-time input and terminal refreshes are correctly defined.
kernel/syscall.c: Ensure that any new system calls related to the game are correctly integrated into the system call table.
user/user.h: Add function prototypes for game-related system calls and utility functions for input and screen updates.
Team Member: Duncan Birdsall @djbirdsall
Command:
The "snake" command will initiate a terminal-based rendition of the classic Snake game. Players will maneuver the snake using keyboard controls, guiding it to consume food and grow while steering clear of collisions with both the walls and the snake’s body.
Plan:
- Implementation:
The
snake
command will render a text-based version of the Snake game in the terminal, displaying the snake, food, and boundaries. The snake will be controlled by the arrow keys or something else if necessary, with food appearing randomly on the grid. The snake will move at a constant speed, and the game ends when it crashes into either the walls or itself.- Key Input:
Players will control the snake’s direction using the keyboard (up, down, left, right). Ensuring the operating system can handle real-time keypresses for arrow keys is crucial, with fallback options for alternative key controls if the OS doesn’t support arrow key input.
- Game Logic:
The game continues until the snake hits the walls or itself, with the current score displayed in the terminal. After a game over, the game will automatically reset.
Files to be Added/Modified:
user/snake.c
: Implement the Snake game logic, including handling movement, collision detection, and difficulty settings.Makefile
: Update to compilesnake.c
along with other OS commands.kernel/syscall.h
: Verify the system calls that handle real-time input and terminal refreshes are correctly defined.kernel/syscall.c
: Ensure that any new system calls related to the game are correctly integrated into the system call table.user/user.h
: Add function prototypes for game-related system calls and utility functions for input and screen updates.