README.md

December 15, 2023 · View on GitHub

dotnet-console-games

GitHub repo Language C# Target Framework Discord License Towel

Game examples implemented as .NET console applications primarily for providing education and inspiration. :)

Recommendation
Play the games, pick a game you like, and try to code the game yourself from scratch.

Game*WeightNotes                                                                      
Guess A Number0Play Now Status
Rock Paper Scissors0Play Now Status
Dice Game0Play Now Status
*Community Contribution
Flash Cards0Play Now Status
Quick Draw1Play Now Status
Tug Of War1Play Now Status
Whack A Mole1Play Now Status
Tic Tac Toe1Play Now Status
Simon1Play Now Status
Roll And Move1Play Now Status
Beep Pad1Status
Warning Only Supported On Windows OS
Draw1Play Now Status
Tower Of Hanoi1Play Now Status
Clicker1Play Now Status
Hangman2Play Now Status
Lights Out2Play Now Status
Wordle2Play Now Status
Memory2Play Now Status
Connect 42Play Now Status
Minesweeper2Play Now Status
Wumpus World2Play Now Status
Rythm2Play Now Status
Type2Play Now Status
Drive2Play Now Status
Sliding Puzzle2Play Now Status
Snake3Play Now Status
Word Search3Play Now Status
Hurdles3Play Now Status
Pong3Play Now Status
Flappy Bird3Play Now Status
Oligopoly3Play Now Status
*Community Contribution
Reversi3Play Now Status
Darts3Play Now Status
Yahtzee4Play Now Status
Tanks4Play Now Status
Helicopter4Play Now Status
20484Play Now Status
Sudoku4Play Now Status
Mancala4Play Now Status
Bound4Play Now Status
Tents4Play Now Status
Battleship4Play Now Status
Checkers4Play Now Status
*Community Contribution
Duck Hunt5Play Now Status
*Community Contribution
Blackjack5Play Now Status
Fighter5Play Now Status
Maze5Play Now Status
PacMan5Play Now Status
Gravity5Play Now Status
Tetris5Play Now Status
*Community Contribution
Shmup5Play Now Status
Warning Only Supported On Windows OS
Role Playing Game6Play Now Status
Console Monsters7Play Now Status
*Community Collaboration
Warning Work In Progress
First Person Shooter8Play Now Status
Warning Only Supported On Windows OS

*Weight: A relative rating for how advanced the source code is.
*Community Contribution: Special thanks to everyone who contributed games!
*Community Collaboration: Games where multiple members of the community participated in the development!

You can play the games in your browser:
Play Now
Hosted On GitHub Pages

Local Setup

Clone the repository or download the repository and unzip the contents. dotnet-console-games should build with any .NET build process, such as one of the following:

Visual Studio [Expand]

  1. Install Visual Studio if not already installed.

  2. Open the File dotnet-console-games.slnf file in Visual Studio.

  3. Run the games with the Debug->Start Debugging (default hotkey F5) option in the menu strip. You can switch games by right clicking the projects in the solution explorer and using the Set as Startup Project option.

Note This is optional, but here are some settings you can change in Visual Studio.

Visual Studio Code [Expand]

  1. Install the .NET SDK if not already installed.

  2. Install Visual Studio Code if not already installed.

  3. Open the Directory root folder of the repository in Visual Studio Code.

  4. Run the games using the Start Debugging green triangle button (default hotkey F5) in the Run and Debug tab. You can switch games in the drop down next to the Start Debugging button.

Note The following files are included in the repository:

  • .vscode/extensions.json recommends Vistual Studio Code extension dependencies
  • .vscode/launch.json includes the configurations for debugging the examples
  • .vscode/settings.json automatically applies settings to the workspace
  • .vscode/tasks.json includes the commands to build the projects

Note You will be prompted to install the necessary Visual Studio Code extensions when you open the folder:

  • ms-dotnettools.csharp C# support

Command Line [Expand]

  1. Install the .NET SDK if not already installed.

  2. Run the games using the dotnet run --project <PROJECT> command where <PROJECT> is the file path to one of the .csproj files. For example, running the dotnet run --project Projects/Drive/Drive.csproj command from the root of the repository will run the Drive game.

Relevant Articles

Beginner's Guide To Console Input In C# August 1, 2020

dotnet Console Games Tips And Tricks April 7, 2022

Get Involved

Want to show support? You can star the github repository.

Have any questions? Start a new discussion.

Find a bug or have a suggestion? Open an issue.

Want to chat with the developer(s)? Join the discord server.

Want to contribute? Look for open issues you can help with.


Supported by the