From d62c8499a55e32253066f73fc696864bb06a1de7 Mon Sep 17 00:00:00 2001 From: JoshLapierre45 Date: Wed, 1 Oct 2025 14:48:42 -0600 Subject: [PATCH 01/11] Josh --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ea47623..14cb661 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Console Game Hub - +# Josh Lapierre Repository for explorations of software development --- From d0ebecc5b7afab41486848b316ffcc9c15305378 Mon Sep 17 00:00:00 2001 From: bfcortesss Date: Wed, 1 Oct 2025 16:52:08 -0400 Subject: [PATCH 02/11] Making a change on README.md - BF --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ea47623..05c6280 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +Brian F. + # Console Game Hub Repository for explorations of software development From 998b9512f4ccff70c8b367adbf636b43ef333494 Mon Sep 17 00:00:00 2001 From: hchagerman <123512775+hchagerman@users.noreply.github.com> Date: Wed, 1 Oct 2025 14:54:00 -0600 Subject: [PATCH 03/11] Update README.md name Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com> --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 14cb661..8caac76 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Console Game Hub # Josh Lapierre +# Hunter Hagerman Repository for explorations of software development --- From 879e1039e9d5b8fd7d28d00e6410635a1929d4cf Mon Sep 17 00:00:00 2001 From: CamCranda11 Date: Wed, 1 Oct 2025 16:58:10 -0400 Subject: [PATCH 04/11] added name --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8caac76..a168ed3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Console Game Hub # Josh Lapierre # Hunter Hagerman +# Cameron Crandall Repository for explorations of software development --- From 601a087986ebf4557e125b305cc5cb5c748c920e Mon Sep 17 00:00:00 2001 From: ahmedbacaad Date: Wed, 1 Oct 2025 17:39:13 -0400 Subject: [PATCH 05/11] added my name --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8bb34fa..c866339 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ Brian F. # Josh Lapierre # Hunter Hagerman # Cameron Crandall +# Ahmed Abdi Repository for explorations of software development --- From 720cc0ea79bdd8b34bdc30efdfeba73111392ef0 Mon Sep 17 00:00:00 2001 From: hchagerman <123512775+hchagerman@users.noreply.github.com> Date: Wed, 8 Oct 2025 14:56:31 -0600 Subject: [PATCH 06/11] Update GameHistoryTracker.java add if Score == null Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com> --- GameHistoryTracker.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/GameHistoryTracker.java b/GameHistoryTracker.java index ffd810e..e4e9faf 100644 --- a/GameHistoryTracker.java +++ b/GameHistoryTracker.java @@ -30,6 +30,9 @@ public void recordPlay(final String gameName, final Integer score) { if (score != null) { stats.totalScore += score; stats.scores.add(score); + } else if (score == null) { + System.out.println("Score is null"); + return; } statsMap.put(gameName, stats); } From aff990cf9a1780a3357037bdd3cb0994554391ab Mon Sep 17 00:00:00 2001 From: CamCranda11 <159499223+CamCranda11@users.noreply.github.com> Date: Wed, 8 Oct 2025 15:45:02 -0600 Subject: [PATCH 07/11] Delete README.md Signed-off-by: CamCranda11 <159499223+CamCranda11@users.noreply.github.com> --- README.md | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 README.md diff --git a/README.md b/README.md deleted file mode 100644 index c866339..0000000 --- a/README.md +++ /dev/null @@ -1,42 +0,0 @@ -Brian F. - -# Console Game Hub -# Josh Lapierre -# Hunter Hagerman -# Cameron Crandall -# Ahmed Abdi -Repository for explorations of software development - ---- ---- -### Overview -This project is a collaborative software development platform -designed for undergraduate CS students, featuring a -console-based arcade of classic and logic-driven games. - -It is intended to help students practice software -development principles (such as, agile development, -test-driven development, object-oriented design, pair-programming, -and refactoring) through fun and meaningful work. - -The goal is to reinforce core and agile software development -concepts and practices by contributing in an engaging, -real-world context. - -#### Test -`ant test` -#### Build -`ant jar` -#### Run -`java -jar build/jar/ConsoleGameHub.jar` - -### Activities - -The [Project](https://github.com/orgs/MetroCS/projects/9) contains a Kanban-style board of project activity - -See the [Issues](https://github.com/MetroCS/ConsoleGameHub/issues) tab for all associated user stories and tasks - ---- -## Information and Examples - -Visit the [website](https://metrocs.github.io/ConsoleGameHub/) for information and to download examples From 6d1a78a02d2b1496fea63967ff768be7a00a57f0 Mon Sep 17 00:00:00 2001 From: CamCranda11 <159499223+CamCranda11@users.noreply.github.com> Date: Wed, 8 Oct 2025 15:51:44 -0600 Subject: [PATCH 08/11] Create README.md Signed-off-by: CamCranda11 <159499223+CamCranda11@users.noreply.github.com> --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..ea47623 --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +# Console Game Hub + +Repository for explorations of software development + +--- +--- +### Overview +This project is a collaborative software development platform +designed for undergraduate CS students, featuring a +console-based arcade of classic and logic-driven games. + +It is intended to help students practice software +development principles (such as, agile development, +test-driven development, object-oriented design, pair-programming, +and refactoring) through fun and meaningful work. + +The goal is to reinforce core and agile software development +concepts and practices by contributing in an engaging, +real-world context. + +#### Test +`ant test` +#### Build +`ant jar` +#### Run +`java -jar build/jar/ConsoleGameHub.jar` + +### Activities + +The [Project](https://github.com/orgs/MetroCS/projects/9) contains a Kanban-style board of project activity + +See the [Issues](https://github.com/MetroCS/ConsoleGameHub/issues) tab for all associated user stories and tasks + +--- +## Information and Examples + +Visit the [website](https://metrocs.github.io/ConsoleGameHub/) for information and to download examples From c730ea203f6e83f1151762f6c4b7061c26a6b9f1 Mon Sep 17 00:00:00 2001 From: bfcortesss Date: Mon, 13 Oct 2025 23:50:34 -0400 Subject: [PATCH 09/11] Added short SudokuGame introduction --- SudokuGame.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/SudokuGame.java b/SudokuGame.java index caa9ecd..ccc00aa 100644 --- a/SudokuGame.java +++ b/SudokuGame.java @@ -18,7 +18,23 @@ public String getName() { @Override public Optional play() { - System.out.println("[Playing Sudoku - Placeholder]"); + printIntro(); + + System.out.println(""); return Optional.empty(); } + + private void printIntro() { + System.out.println( + "Sudoku is a 9x9 number puzzle. Fill the grid so each row, column, and 3x3 box " + + "contains the digits 1-9 exactly once. Use logic to complete the board."); + } + + +public static void main(String[] args) { + SudokuGame game = new SudokuGame(); + game.play(); + + } +} From ac9fe2060a146c35991645cfc3f1406c24867b06 Mon Sep 17 00:00:00 2001 From: bfcortesss Date: Wed, 15 Oct 2025 16:34:53 -0400 Subject: [PATCH 10/11] Adding description to SudokuGame.java --- SudokuGame.java | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/SudokuGame.java b/SudokuGame.java index ccc00aa..09da87a 100644 --- a/SudokuGame.java +++ b/SudokuGame.java @@ -18,23 +18,17 @@ public String getName() { @Override public Optional play() { - printIntro(); + System.out.println("[Playing Sudoku - Placeholder]"); + System.out.println("Welcome to Sudoku! You will be presented with" + + " a 9x9 grid split into 9 different 3x3 grids." + + " Some of the cells will already be filled in" + + " with numbers. Each digit from 1-9 must" + + " appear exactly once in every" + + " row, column, and 3x3 grid. To solve the puzzle," + + " each cell must be filled in according to the" + + " following conditions"); - System.out.println(""); return Optional.empty(); - } - - private void printIntro() { - System.out.println( - "Sudoku is a 9x9 number puzzle. Fill the grid so each row, column, and 3x3 box " + - "contains the digits 1-9 exactly once. Use logic to complete the board."); - -} - - -public static void main(String[] args) { - SudokuGame game = new SudokuGame(); - game.play(); } -} +} From ac6633b8d10f7536d4c9398b6f7f86f8c50aa1e9 Mon Sep 17 00:00:00 2001 From: bfcortesss Date: Tue, 28 Oct 2025 00:08:02 -0400 Subject: [PATCH 11/11] Validate 5-letter alphabetic guess. So that invalid input does not consume attempts. --- WordGuessGame.java | 55 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/WordGuessGame.java b/WordGuessGame.java index e40967d..f9dec4d 100644 --- a/WordGuessGame.java +++ b/WordGuessGame.java @@ -1,5 +1,5 @@ import java.util.Optional; - +import java.util.Scanner; /** * A word guessing game similar to Wordle. * The player has a limited number of attempts to guess a secret @@ -12,7 +12,21 @@ */ class WordGuessGame implements Game { - @Override +// Acceots 5 Alphabetic letters ASCII A-Z or a-z.// +public String GuessCondition = "^[A-Za-z]{5}$"; +// Maximum number of attempts a player gets // +public int MaxAttempts = 6; + +/** +*Checks if a guess is valid, non-null, and alphabetic +* +*@param guess The user's guess. +*@return true if valid, false otherwise, +*/ +boolean isValidGuess(String guess) { + return guess != null && guess.matches(GuessCondition); +} + @Override public String getName() { return "Word Guess"; } @@ -31,6 +45,39 @@ public Optional play() { "Your score is determined by the number of attempts remaining" + " after you guessed the word correctly!" ); - return Optional.empty(); - } + +//Remaining attempts and user input// +int attemptsLeft = MaxAttempts; +Scanner scanner = new Scanner(System.in); + +//Loop will continue while player has attempts remaining// +while (attemptsLeft > 0) { +String guess; + +//Loop prompts until a valid guess is entered// +while (true) { + System.out.print +("Enter a 5-Letter Word: "); + guess = scanner.nextLine(); + + if (!isValidGuess(guess)) { + System.out.println("Inavlid Input: Please enter 5 alphabetic letters (A-Z)."); + continue; +} + guess = guess.toUpperCase(); + break; +} + +//Valid input consumes one attempt// +attemptsLeft--; +System.out.println("Guess Accepted. Attempts Left: " + attemptsLeft); + +break; + +} + +return Optional.empty(); + +} + }