diff --git a/.github/workflows/Clicker Build.yml b/.github/workflows/Clicker Build.yml
new file mode 100644
index 00000000..889b7698
--- /dev/null
+++ b/.github/workflows/Clicker Build.yml
@@ -0,0 +1,20 @@
+name: Clicker Build
+on:
+ push:
+ paths:
+ - 'Projects/Clicker/**'
+ - '!**.md'
+ pull_request:
+ paths:
+ - 'Projects/Clicker/**'
+ - '!**.md'
+ workflow_dispatch:
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-dotnet@v3
+ with:
+ dotnet-version: 7.0.x
+ - run: dotnet build "Projects\Clicker\Clicker.csproj" --configuration Release
diff --git a/.vscode/launch.json b/.vscode/launch.json
index a6a89bac..476816fe 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -132,6 +132,16 @@
"console": "externalTerminal",
"stopAtEntry": false,
},
+ {
+ "name": "Clicker",
+ "type": "coreclr",
+ "request": "launch",
+ "preLaunchTask": "Build Clicker",
+ "program": "${workspaceFolder}/Projects/Clicker/bin/Debug/Clicker.dll",
+ "cwd": "${workspaceFolder}/Projects/Clicker/bin/Debug",
+ "console": "externalTerminal",
+ "stopAtEntry": false,
+ },
{
"name": "Hangman",
"type": "coreclr",
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index 6d9ec4a1..2f312b30 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -626,6 +626,19 @@
],
"problemMatcher": "$msCompile",
},
+ {
+ "label": "Build Clicker",
+ "command": "dotnet",
+ "type": "process",
+ "args":
+ [
+ "build",
+ "${workspaceFolder}/Projects/Clicker/Clicker.csproj",
+ "/property:GenerateFullPaths=true",
+ "/consoleloggerparameters:NoSummary",
+ ],
+ "problemMatcher": "$msCompile",
+ },
{
"label": "Build Solution",
"command": "dotnet",
diff --git a/Projects/Clicker/Clicker.csproj b/Projects/Clicker/Clicker.csproj
new file mode 100644
index 00000000..6d3f6cb5
--- /dev/null
+++ b/Projects/Clicker/Clicker.csproj
@@ -0,0 +1,8 @@
+
+
+ Exe
+ net7.0
+ disable
+ enable
+
+
diff --git a/Projects/Clicker/Program.cs b/Projects/Clicker/Program.cs
new file mode 100644
index 00000000..83540dd0
--- /dev/null
+++ b/Projects/Clicker/Program.cs
@@ -0,0 +1,101 @@
+using System;
+using System.Globalization;
+using System.Numerics;
+
+char[] keys =
+{
+ 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P',
+ 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L',
+ 'Z', 'X', 'C', 'V', 'B', 'N', 'M',
+};
+
+MainMenu:
+Console.Clear();
+Console.WriteLine(
+ $"""
+ Clicker
+
+ In this game you will continually click
+ keys on your keyboard to increase your
+ score, but you cannot press the same key
+ twice in a row. :P You will start with
+ the [{keys[0]}] & [{keys[1]}] keys but unlock additional
+ keys as you click.
+
+ NOTE FROM DEVELOPER: Do not play this game.
+ Clicker games are nothing but a waste of
+ your time. I only made this game as an
+ educational example.
+
+ ESC: close game
+ ENTER: continue
+ """);
+MainMenuInput:
+Console.CursorVisible = false;
+switch (Console.ReadKey(true).Key)
+{
+ case ConsoleKey.Enter: break;
+ case ConsoleKey.Escape: Console.Clear(); return;
+ default: goto MainMenuInput;
+}
+
+DateTime start = DateTime.Now;
+BigInteger clicks = 0;
+ConsoleKey previous = default;
+Console.Clear();
+while (true)
+{
+ string clicksString = clicks.ToString(CultureInfo.InvariantCulture);
+ int keyCount = clicksString.Length + 1;
+
+ if (keyCount > keys.Length)
+ {
+ TimeSpan duration = DateTime.Now - start;
+ Console.Clear();
+ Console.WriteLine(
+ $"""
+ Clicker
+
+ You Win!
+
+ Your time: {duration}
+
+ ESC: return to main menu
+ """);
+ GameOverInput:
+ Console.CursorVisible = false;
+ switch (Console.ReadKey(true).Key)
+ {
+ case ConsoleKey.Escape: goto MainMenu;
+ default: goto GameOverInput;
+ }
+ }
+
+ Console.SetCursorPosition(0, 0);
+ Console.WriteLine(
+ $"""
+ Clicker
+
+ Clicks: {clicksString}
+
+ Keys: {string.Join(" ", keys[0..keyCount])}
+
+ ESC: return to main menu
+ """);
+ ClickerInput:
+ Console.CursorVisible = false;
+ ConsoleKey key = Console.ReadKey(true).Key;
+ switch (key)
+ {
+ case >= ConsoleKey.A and <= ConsoleKey.Z:
+ int index = Array.IndexOf(keys, (char)key);
+ if (index < keyCount && key != previous)
+ {
+ previous = key;
+ clicks += index > 1 ? BigInteger.Pow(10, index > 1 ? index - 1 : 0) / (index - 1) : 1;
+ }
+ break;
+ case ConsoleKey.Escape: goto MainMenu;
+ default: goto ClickerInput;
+ }
+}
\ No newline at end of file
diff --git a/Projects/Clicker/README.md b/Projects/Clicker/README.md
new file mode 100644
index 00000000..6443f181
--- /dev/null
+++ b/Projects/Clicker/README.md
@@ -0,0 +1,48 @@
+
+ Clicker
+
+
+
+
+
+
+
+
+
+
+
+
+ You can play this game in your browser:
+
+
+
+
+
+ Hosted On GitHub Pages
+
+
+Clicker is a... clicker game. You just click to increase your number of clicks. That is it.
+
+```
+ Clicker
+
+ Clicks: 11651
+
+ Keys: Q W E R T Y
+
+ ESC: return to main menu
+```
+
+## Input
+
+- `A`-`Z`: click
+- `enter`: continue
+- `escape`: return to main menu and exit game
+
+## Downloads
+
+[win-x64](https://github.com/dotnet/dotnet-console-games/raw/binaries/win-x64/Clicker.exe)
+
+[linux-x64](https://github.com/dotnet/dotnet-console-games/raw/binaries/linux-x64/Clicker)
+
+[osx-x64](https://github.com/dotnet/dotnet-console-games/raw/binaries/osx-x64/Clicker)
diff --git a/Projects/Website/Games/Clicker/Clicker.cs b/Projects/Website/Games/Clicker/Clicker.cs
new file mode 100644
index 00000000..d147ec7c
--- /dev/null
+++ b/Projects/Website/Games/Clicker/Clicker.cs
@@ -0,0 +1,116 @@
+using System;
+using System.Globalization;
+using System.Numerics;
+using System.Threading.Tasks;
+
+namespace Website.Games.Clicker;
+
+public class Clicker
+{
+ public readonly BlazorConsole Console = new();
+
+ public async Task Run()
+ {
+ char[] keys =
+ {
+ 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P',
+ 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L',
+ 'Z', 'X', 'C', 'V', 'B', 'N', 'M',
+ };
+
+ MainMenu:
+ await Console.Clear();
+ await Console.WriteLine(
+ $"""
+ Clicker
+
+ In this game you will continually click
+ keys on your keyboard to increase your
+ score, but you cannot press the same key
+ twice in a row. :P You will start with
+ the [{keys[0]}] & [{keys[1]}] keys but unlock additional
+ keys as you click.
+
+ NOTE FROM DEVELOPER: Do not play this game.
+ Clicker games are nothing but a waste of
+ your time. I only made this game as an
+ educational example.
+
+ ESC: close game
+ ENTER: continue
+ """);
+ MainMenuInput:
+ Console.CursorVisible = false;
+ switch ((await Console.ReadKey(true)).Key)
+ {
+ case ConsoleKey.Enter: break;
+ case ConsoleKey.Escape:
+ await Console.Clear();
+ await Console.WriteLine("Clicker was closed.");
+ await Console.Refresh();
+ return;
+ default: goto MainMenuInput;
+ }
+
+ DateTime start = DateTime.Now;
+ BigInteger clicks = 0;
+ ConsoleKey previous = default;
+ await Console.Clear();
+ while (true)
+ {
+ string clicksString = clicks.ToString(CultureInfo.InvariantCulture);
+ int keyCount = clicksString.Length + 1;
+
+ if (keyCount > keys.Length)
+ {
+ TimeSpan duration = DateTime.Now - start;
+ await Console.Clear();
+ await Console.WriteLine(
+ $"""
+ Clicker
+
+ You Win!
+
+ Your time: {duration}
+
+ ESC: return to main menu
+ """);
+ GameOverInput:
+ Console.CursorVisible = false;
+ switch ((await Console.ReadKey(true)).Key)
+ {
+ case ConsoleKey.Escape: goto MainMenu;
+ default: goto GameOverInput;
+ }
+ }
+
+ await Console.SetCursorPosition(0, 0);
+ await Console.WriteLine(
+ $"""
+ Clicker
+
+ Clicks: {clicksString}
+
+ Keys: {string.Join(" ", keys[0..keyCount])}
+
+ ESC: return to main menu
+ """);
+ ClickerInput:
+ Console.CursorVisible = false;
+ ConsoleKey key = (await Console.ReadKey(true)).Key;
+ switch (key)
+ {
+ case >= ConsoleKey.A and <= ConsoleKey.Z:
+ int index = Array.IndexOf(keys, (char)key);
+ if (index < keyCount && key != previous)
+ {
+ previous = key;
+ clicks += index > 1 ? BigInteger.Pow(10, index > 1 ? index - 1 : 0) / (index - 1) : 1;
+ }
+ break;
+ case ConsoleKey.Escape: goto MainMenu;
+ default: goto ClickerInput;
+ }
+ }
+ }
+}
diff --git a/Projects/Website/Pages/Checkers.razor b/Projects/Website/Pages/Checkers.razor
index bdc799c5..d8804f57 100644
--- a/Projects/Website/Pages/Checkers.razor
+++ b/Projects/Website/Pages/Checkers.razor
@@ -37,6 +37,10 @@
↻ You can restart the game by refreshing the page.
+
+
@code
{
Games.Checkers.Checkers Game;
diff --git a/Projects/Website/Pages/Clicker.razor b/Projects/Website/Pages/Clicker.razor
new file mode 100644
index 00000000..55bb63db
--- /dev/null
+++ b/Projects/Website/Pages/Clicker.razor
@@ -0,0 +1,74 @@
+@using System
+
+@page "/Clicker"
+
+Clicker
+
+Clicker
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ⌨ Keyboard input is supported if you click on the game.
+
+
+
+ ↻ You can restart the game by refreshing the page.
+
+
+@code
+{
+ Games.Clicker.Clicker Game;
+ BlazorConsole Console;
+
+ public Clicker()
+ {
+ Game = new();
+ Console = Game.Console;
+ Console.WindowWidth = 82;
+ Console.WindowHeight = 25;
+ Console.TriggerRefresh = StateHasChanged;
+ }
+
+ protected override void OnInitialized() => InvokeAsync(Game.Run);
+}
diff --git a/Projects/Website/Shared/NavMenu.razor b/Projects/Website/Shared/NavMenu.razor
index 13e74349..b2c080a1 100644
--- a/Projects/Website/Shared/NavMenu.razor
+++ b/Projects/Website/Shared/NavMenu.razor
@@ -68,6 +68,11 @@
Tower Of Hanoi
+
+
+ Clicker
+
+
Hangman
diff --git a/README.md b/README.md
index 19663231..05a836ef 100644
--- a/README.md
+++ b/README.md
@@ -37,6 +37,7 @@
|[Beep Pad](Projects/Beep%20Pad)|1|[![Status](https://github.com/dotnet/dotnet-console-games/workflows/Beep%20Pad%20Build/badge.svg)](https://github.com/dotnet/dotnet-console-games/actions)
[![Warning](https://raw.githubusercontent.com/dotnet/dotnet-console-games/main/.github/resources/warning-icon.svg)](#) _Only Supported On Windows OS_|
|[Draw](Projects/Draw)|1|[![Play Now](.github/resources/play-badge.svg)](https://dotnet.github.io/dotnet-console-games/Draw) [![Status](https://github.com/dotnet/dotnet-console-games/workflows/Draw%20Build/badge.svg)](https://github.com/dotnet/dotnet-console-games/actions)|
|[Tower Of Hanoi](Projects/Tower%20Of%20Hanoi)|1|[![Play Now](.github/resources/play-badge.svg)](https://dotnet.github.io/dotnet-console-games/Tower%20Of%20Hanoi) [![Status](https://github.com/dotnet/dotnet-console-games/workflows/Tower%20Of%20Hanoi%20Build/badge.svg)](https://github.com/dotnet/dotnet-console-games/actions)|
+|[Clicker](Projects/Clicker)|1|[![Play Now](.github/resources/play-badge.svg)](https://dotnet.github.io/dotnet-console-games/Clicker) [![Status](https://github.com/dotnet/dotnet-console-games/workflows/Clicker%20Build/badge.svg)](https://github.com/dotnet/dotnet-console-games/actions)|
|[Hangman](Projects/Hangman)|2|[![Play Now](.github/resources/play-badge.svg)](https://dotnet.github.io/dotnet-console-games/Hangman) [![Status](https://github.com/dotnet/dotnet-console-games/workflows/Hangman%20Build/badge.svg)](https://github.com/dotnet/dotnet-console-games/actions)|
|[Wordle](Projects/Wordle)|2|[![Play Now](.github/resources/play-badge.svg)](https://dotnet.github.io/dotnet-console-games/Wordle) [![Status](https://github.com/dotnet/dotnet-console-games/workflows/Wordle%20Build/badge.svg)](https://github.com/dotnet/dotnet-console-games/actions)|
|[Memory](Projects/Memory)|2|[![Play Now](.github/resources/play-badge.svg)](https://dotnet.github.io/dotnet-console-games/Memory) [![Status](https://github.com/dotnet/dotnet-console-games/workflows/Memory%20Build/badge.svg)](https://github.com/dotnet/dotnet-console-games/actions)|
diff --git a/dotnet-console-games.sln b/dotnet-console-games.sln
index ac9bbc35..1cd68ef3 100644
--- a/dotnet-console-games.sln
+++ b/dotnet-console-games.sln
@@ -99,7 +99,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Darts", "Projects\Darts\Dar
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flash Cards", "Projects\Flash Cards\Flash Cards.csproj", "{62BD025E-693C-4524-AE89-07D74EB2931B}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shmup", "Projects\Shmup\Shmup.csproj", "{E5B5E93F-CEE2-431C-B371-D7AC9C9A4973}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Shmup", "Projects\Shmup\Shmup.csproj", "{E5B5E93F-CEE2-431C-B371-D7AC9C9A4973}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Clicker", "Projects\Clicker\Clicker.csproj", "{C408B9C3-5F16-4F0A-B0D0-F39A6F7F0B72}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -303,6 +305,10 @@ Global
{E5B5E93F-CEE2-431C-B371-D7AC9C9A4973}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E5B5E93F-CEE2-431C-B371-D7AC9C9A4973}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E5B5E93F-CEE2-431C-B371-D7AC9C9A4973}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C408B9C3-5F16-4F0A-B0D0-F39A6F7F0B72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C408B9C3-5F16-4F0A-B0D0-F39A6F7F0B72}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C408B9C3-5F16-4F0A-B0D0-F39A6F7F0B72}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C408B9C3-5F16-4F0A-B0D0-F39A6F7F0B72}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/dotnet-console-games.slnf b/dotnet-console-games.slnf
index fb3c5b44..4cfb281f 100644
--- a/dotnet-console-games.slnf
+++ b/dotnet-console-games.slnf
@@ -8,6 +8,7 @@
"Projects\\Bound\\Bound.csproj",
"Projects\\Blackjack\\Blackjack.csproj",
"Projects\\Checkers\\Checkers.csproj",
+ "Projects\\Clicker\\Clicker.csproj",
"Projects\\Connect 4\\Connect 4.csproj",
"Projects\\Console Monsters\\Console Monsters.csproj",
"Projects\\Darts\\Darts.csproj",