Home

Awesome

<p align="center"> <a href=".github/resources/animated-banner-credit.md"><img width="600" src=".github/resources/animated-banner.gif?raw=true" ></a> </p> <h1 align="center"> dotnet-console-games </h1> <p align="center"> <a href="https://github.com/dotnet/dotnet-console-games"><img src=".github/resources/github-repo-black.svg" alt="GitHub repo"></a> <a href="https://docs.microsoft.com/en-us/dotnet/csharp/"><img src=".github/resources/language-csharp.svg" alt="Language C#"></a> <a href="https://dotnet.microsoft.com/download"><img src=".github/resources/dotnet-badge.svg" alt="Target Framework"></a> <a href="https://discord.gg/4XbQbwF"><img src=".github/resources/discord-badge.svg" alt="Discord"/></a> <a href="LICENSE"><img alt="License" src=".github/resources/license-MIT-green.svg" alt="License"></a> <a href="https://github.com/ZacharyPatten/Towel"><img src="https://github.com/ZacharyPatten/Towel/blob/main/.github/Resources/UsingTowel.svg?raw=true" alt="Towel"></a> </p> <p align="center"> Game examples implemented as .NET console applications primarily for providing education and inspiration. :) </p>

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

Game*WeightNotes                                                                      
Guess A Number0<sub>Play Now Status</sub>
Rock Paper Scissors0<sub>Play Now Status</sub>
Dice Game0<sub>Play Now Status</sub><br/><sup>*Community Contribution</sup>
Flash Cards0<sub>Play Now Status</sub>
Quick Draw1<sub>Play Now Status</sub>
Tug Of War1<sub>Play Now Status</sub>
Whack A Mole1<sub>Play Now Status</sub>
Tic Tac Toe1<sub>Play Now Status</sub>
Simon1<sub>Play Now Status</sub>
Roll And Move1<sub>Play Now Status</sub>
Beep Pad1<sub>Status</sub><br/><sup><sub><sub>Warning</sub></sub> Only Supported On Windows OS</sup>
Draw1<sub>Play Now Status</sub>
Tower Of Hanoi1<sub>Play Now Status</sub>
Clicker1<sub>Play Now Status</sub>
Hangman2<sub>Play Now Status</sub>
Lights Out2<sub>Play Now Status</sub>
Wordle2<sub>Play Now Status</sub>
Memory2<sub>Play Now Status</sub>
Connect 42<sub>Play Now Status</sub>
Minesweeper2<sub>Play Now Status</sub>
Wumpus World2<sub>Play Now Status</sub>
Rythm2<sub>Play Now Status</sub>
Type2<sub>Play Now Status</sub>
Drive2<sub>Play Now Status</sub>
Sliding Puzzle2<sub>Play Now Status</sub>
Snake3<sub>Play Now Status</sub>
Word Search3<sub>Play Now Status</sub>
Hurdles3<sub>Play Now Status</sub>
Pong3<sub>Play Now Status</sub>
Flappy Bird3<sub>Play Now Status</sub>
Oligopoly3<sub>Play Now Status</sub><br/><sup>*Community Contribution</sup>
Reversi3<sub>Play Now Status</sub>
Darts3<sub>Play Now Status</sub>
Yahtzee4<sub>Play Now Status</sub>
Tanks4<sub>Play Now Status</sub>
Helicopter4<sub>Play Now Status</sub>
20484<sub>Play Now Status</sub>
Sudoku4<sub>Play Now Status</sub>
Mancala4<sub>Play Now Status</sub>
Bound4<sub>Play Now Status</sub>
Tents4<sub>Play Now Status</sub>
Battleship4<sub>Play Now Status</sub>
Checkers4<sub>Play Now Status</sub><br/><sup>*Community Contribution</sup>
Duck Hunt5<sub>Play Now Status</sub><br/><sup>*Community Contribution</sup>
Blackjack5<sub>Play Now Status</sub>
Fighter5<sub>Play Now Status</sub>
Maze5<sub>Play Now Status</sub>
PacMan5<sub>Play Now Status</sub>
Gravity5<sub>Play Now Status</sub>
Tetris5<sub>Play Now Status</sub><br/><sup>*Community Contribution</sup>
Shmup5<sub>Play Now Status</sub><br/><sup><sub><sub>Warning</sub></sub> Only Supported On Windows OS</sup>
Role Playing Game6<sub>Play Now Status</sub>
Console Monsters7<sub>Play Now Status</sub><br/><sup>*Community Collaboration</sup><br/><sup><sub><sub>Warning</sub></sub> Work In Progress</sup>
First Person Shooter8<sub>Play Now Status</sub><br/><sup><sub><sub>Warning</sub></sub> Only Supported On Windows OS</sup>

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

<p align="center"> You can play the games in your browser: <br /> <a href="https://dotnet.github.io/dotnet-console-games"> <sub><img height="40"src=".github/resources/play-badge.svg" alt="Play Now"></sub> </a> <br /> <sup>Hosted On GitHub Pages</sup> </p>

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:

<details> <summary> Visual Studio <sub>[Expand]</sub> </summary> <p>
  1. Install Visual Studio if not already installed.

  2. Open the <sub>File</sub> 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.

</p> </details> <details> <summary> Visual Studio Code <sub>[Expand]</sub> </summary> <p>
  1. Install the .NET SDK if not already installed.

  2. Install Visual Studio Code if not already installed.

  3. Open the <sub>Directory</sub> 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:

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

</p> </details> <details> <summary> Command Line <sub>[Expand]</sub> </summary> <p>
  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.

</p> </details>

Relevant Articles

Beginner's Guide To Console Input In C# <sub>August 1, 2020</sub><br/>

dotnet Console Games Tips And Tricks <sub>April 7, 2022</sub>

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.

<br /> <p align="center"> <sub>Supported by the</sub> <br /> <a href="https://dotnetfoundation.org"><img width="300" src="https://raw.githubusercontent.com/dotnet-foundation/swag/main/logo/dotnetfoundation_v4_horizontal.svg" ></a> </p>