dotnet / dotnet-console-games

Game examples implemented as .NET console applications primarily for providing education and inspiration. :)
https://dotnet.github.io/dotnet-console-games/
MIT License
843 stars 126 forks source link
2048 blazor cli-game console-game csharp dotnet examples flappy-bird game games hangman ideas maze minesweeper pacman rpg snake sudoku terminal-game wordle

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 *Weight Notes                                                                      
Guess A Number 0 Play Now Status
Rock Paper Scissors 0 Play Now Status
Dice Game 0 Play Now Status
*Community Contribution
Flash Cards 0 Play Now Status
Quick Draw 1 Play Now Status
Tug Of War 1 Play Now Status
Whack A Mole 1 Play Now Status
Tic Tac Toe 1 Play Now Status
Simon 1 Play Now Status
Roll And Move 1 Play Now Status
Beep Pad 1 Status
Warning Only Supported On Windows OS
Draw 1 Play Now Status
Tower Of Hanoi 1 Play Now Status
Clicker 1 Play Now Status
Hangman 2 Play Now Status
Lights Out 2 Play Now Status
Wordle 2 Play Now Status
Memory 2 Play Now Status
Connect 4 2 Play Now Status
Minesweeper 2 Play Now Status
Wumpus World 2 Play Now Status
Rythm 2 Play Now Status
Type 2 Play Now Status
Drive 2 Play Now Status
Sliding Puzzle 2 Play Now Status
Snake 3 Play Now Status
Word Search 3 Play Now Status
Hurdles 3 Play Now Status
Pong 3 Play Now Status
Flappy Bird 3 Play Now Status
Oligopoly 3 Play Now Status
*Community Contribution
Reversi 3 Play Now Status
Darts 3 Play Now Status
Yahtzee 4 Play Now Status
Tanks 4 Play Now Status
Helicopter 4 Play Now Status
2048 4 Play Now Status
Sudoku 4 Play Now Status
Mancala 4 Play Now Status
Bound 4 Play Now Status
Tents 4 Play Now Status
Battleship 4 Play Now Status
Checkers 4 Play Now Status
*Community Contribution
Duck Hunt 5 Play Now Status
*Community Contribution
Blackjack 5 Play Now Status
Fighter 5 Play Now Status
Maze 5 Play Now Status
PacMan 5 Play Now Status
Gravity 5 Play Now Status
Tetris 5 Play Now Status
*Community Contribution
Shmup 5 Play Now Status
Warning Only Supported On Windows OS
Role Playing Game 6 Play Now Status
Console Monsters 7 Play Now Status
*Community Collaboration
Warning Work In Progress
First Person Shooter 8 Play 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](https://visualstudio.microsoft.com/) if not already installed. > > 2. Open the [![File](.github/resources/file-16.svg)](#) **`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](https://gist.github.com/ZacharyPatten/693f35653f6c21fbe6c85444792e524b).

Visual Studio Code [Expand]

> 1. Install the [.NET SDK](https://dotnet.microsoft.com/download) if not already installed. > > 2. Install [Visual Studio Code](https://visualstudio.microsoft.com/) if not already installed. > > 3. Open the [![Directory](.github/resources/file-directory-16.svg)](#) **`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](https://dotnet.microsoft.com/download) if not already installed. > > 2. Run the games using the [`dotnet run --project ` command](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-run) where `` 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