A collection of simple console-based games written in C++.
A two-player Rock Paper Scissors game where players compete in multiple rounds.
Features:
- Two-player gameplay
- Multiple rounds with score tracking
- Input validation for game moves
- Display of current scores
How to Play:
- Enter names for both players
- Each round, both players enter their choice: rock, paper, or scissors
- First player to enter an invalid move ends the game
- Winner is determined by standard Rock Paper Scissors rules
A classic Snake game where you navigate a growing snake to eat fruit.
Features:
- Real-time gameplay
- Snake grows as it eats fruit
- Score tracking
- Game over on collision with walls or self
Controls:
w- Move ups- Move downd- Move righta- Move leftx- Exit game
Game Rules:
- Navigate the snake (represented by
Ofor head andofor body) to eat fruit (#) - Each fruit eaten increases your score by 1 and grows the snake
- Game ends if the snake hits the walls or itself
- Game board is 40x20
A two-player Tic Tac Toe game on a 3x3 board.
Features:
- Two-player alternating turns
- Position-based input system (positions numbered 1-9)
- Win detection for rows, columns, and diagonals
- Draw detection
How to Play:
- Positions are numbered 1-9 on a 3x3 grid
- Players alternate turns, starting with X
- Enter the position number where you want to place your mark
- First player to get three in a row (horizontally, vertically, or diagonally) wins
- Game declares a draw if all positions are filled with no winner
- C++ compiler (Visual Studio, MinGW, or GCC)
- Windows operating system (due to
conio.handWindows.hdependencies in snake.cpp)
Compile each game individually:
g++ rock_paper.cpp -o rock_paper.exe
g++ snake.cpp -o snake.exe
g++ x,o.cpp -o xo.exeOr using Visual Studio:
cl rock_paper.cpp
cl snake.cpp
cl x,o.cpp./rock_paper.exe
./snake.exe
./xo.exe- The Snake game uses Windows-specific libraries (
conio.h,Windows.h), so it will only compile on Windows systems - All games are console-based with simple text-based interfaces
- The games store score/progress in memory during gameplay only