Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding snake command to FogOS #70

Open
snarayan57982 opened this issue Sep 16, 2024 · 1 comment
Open

Adding snake command to FogOS #70

snarayan57982 opened this issue Sep 16, 2024 · 1 comment

Comments

@snarayan57982
Copy link

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 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.
@malensek
Copy link
Contributor

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants