Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
5d7a631
roulette
josemcastillo7 Mar 23, 2026
de6be29
BlackJackFolder
Jstrine09 Mar 24, 2026
356a342
Edits to Black Jack files
Jstrine09 Mar 24, 2026
ea256f8
Craps Folder
Jstrine09 Mar 24, 2026
5c66bc5
Number Guess
Zoedayz Mar 25, 2026
0fe7e4f
Work on GameInterface and PlayerInterface to create shell
Jstrine09 Mar 25, 2026
aeb0b44
slots
Nishatlabiba98 Mar 25, 2026
a0e8b43
review
josemcastillo7 Mar 25, 2026
061eb84
review2
josemcastillo7 Mar 25, 2026
0860600
Merge pull request #27 from Zoedayz/Josephs
Zoedayz Mar 25, 2026
36e1140
Merge pull request #26 from Zoedayz/nishat
Zoedayz Mar 25, 2026
06712c8
Merge pull request #28 from Zoedayz/JamesBranch
Zoedayz Mar 25, 2026
afb2628
hanging in there for hangman
Nishatlabiba98 Mar 25, 2026
100e773
Some error fixing
Jstrine09 Mar 25, 2026
807dc4f
Edits to remove errors
Jstrine09 Mar 25, 2026
3b47a49
Moved hangman to its own folder
Jstrine09 Mar 25, 2026
8da076a
Fixed Casino.java
Jstrine09 Mar 25, 2026
d5cb81b
Merge pull request #29 from Zoedayz/nishat
Zoedayz Mar 25, 2026
7eb9805
Merge branch 'master' of https://github.com/Zoedayz/GroupCasino into …
Jstrine09 Mar 25, 2026
b513e9f
Craps fill in and dice edits
Jstrine09 Mar 25, 2026
3826054
Got rid of empty hangman folder
Jstrine09 Mar 25, 2026
52e2542
Edits to CasinoAccountManager
Jstrine09 Mar 25, 2026
4b38692
Merge pull request #32 from Zoedayz/JamesBranch
Zoedayz Mar 25, 2026
693cc75
Minor change to Slots Player class
Jstrine09 Mar 25, 2026
23a27c1
hangman hung
Nishatlabiba98 Mar 25, 2026
69c4af8
Merge pull request #40 from Zoedayz/nishat
Zoedayz Mar 25, 2026
11cae3f
Merge branch 'master' of https://github.com/Zoedayz/GroupCasino into …
Jstrine09 Mar 25, 2026
bc0063a
Merge branch 'master' of https://github.com/Zoedayz/GroupCasino into …
Zoedayz Mar 26, 2026
bbf4233
Added Manage-Account button
Jstrine09 Mar 26, 2026
52ba39b
Small changes to Casino.java
Jstrine09 Mar 26, 2026
1e09e06
Edits To Game and Player
Zoedayz Mar 26, 2026
0086852
Merge pull request #43 from Zoedayz/mahalacasino
Zoedayz Mar 26, 2026
3c2e9e4
Merge branch 'master' of https://github.com/Zoedayz/GroupCasino into …
Jstrine09 Mar 26, 2026
ba75f8f
Edits to Number Guess
Jstrine09 Mar 26, 2026
b3b51d4
Updates to Numbers Game annd Player
Zoedayz Mar 26, 2026
28b46f5
Merge pull request #45 from Zoedayz/mahalacasino
Zoedayz Mar 27, 2026
7ba8403
Merge branch 'master' of https://github.com/Zoedayz/GroupCasino into …
Jstrine09 Mar 27, 2026
6ca9543
Merge pull request #46 from Zoedayz/JamesBranch
Zoedayz Mar 27, 2026
4a333dd
Whitespace
Jstrine09 Mar 27, 2026
e002de1
Small line change
Jstrine09 Mar 27, 2026
ffa7152
Balance viewing changes
Jstrine09 Mar 27, 2026
fb945f6
BlackJack UML alignment
Jstrine09 Mar 27, 2026
9a1c498
Dice Unicode
Zoedayz Mar 27, 2026
cd3efea
goodbye message updated and updated code to stay within the same acco…
Nishatlabiba98 Mar 27, 2026
f5da599
Edits to get UNICODE Symbols
Jstrine09 Mar 27, 2026
89538bc
Craps Unicode w/o numbers
Zoedayz Mar 27, 2026
63a00fc
Merge pull request #52 from Zoedayz/nishat
Zoedayz Mar 27, 2026
8a5a5f1
Merge branch 'master' of https://github.com/Zoedayz/GroupCasino into …
Jstrine09 Mar 27, 2026
bc63855
Merge pull request #53 from Zoedayz/mahalacasino
Zoedayz Mar 28, 2026
b9fc4d2
Merge branch 'master' of https://github.com/Zoedayz/GroupCasino into …
Jstrine09 Mar 28, 2026
56329f4
Edits for UNICODE
Jstrine09 Mar 28, 2026
067ad6c
Edits to Casino.java
Jstrine09 Mar 30, 2026
5fba692
Merge pull request #55 from Zoedayz/JamesBranch
Zoedayz Mar 30, 2026
34d1e1c
Added back option to games menu
Jstrine09 Mar 30, 2026
219c1a0
Merge pull request #56 from Zoedayz/JamesBranch
Zoedayz Mar 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .claude/worktrees/zealous-curran
Submodule zealous-curran added at e6982a
87 changes: 87 additions & 0 deletions docs/readme-uml.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# GroupCasino UML (README-Aligned)

```mermaid
classDiagram
direction LR

class MainApplication {
+main(args String[]) void
}

class Casino {
-console IOConsole
+run() void
-getArcadeDashboardInput() String
-getGameSelectionInput() String
-play(gameObject Object, playerObject Object) void
}

class CasinoAccountManager {
+getAccount(accountName String, accountPassword String) CasinoAccount
+createAccount(accountName String, accountPassword String) CasinoAccount
+registerAccount(casinoAccount CasinoAccount) void
}

class CasinoAccount {
-username String
-password String
-balance double
+depositToBalance(amount double) void
+withdrawBalance(amount double) void
+getUsername() String
+getPassword() String
+getBalance() double
}

class GameInterface {
<<interface>>
+add(player PlayerInterface) void
+remove(player PlayerInterface) void
+run() void
}

class PlayerInterface {
<<interface>>
+getArcadeAccount() CasinoAccount
+play() SomeReturnType
}

class SlotsGame
class NumberGuessGame
class BlackjackGame

class SlotsPlayer
class NumberGuessPlayer
class BlackjackPlayer

class Deck
class Card
class BlackjackHand

MainApplication --> Casino : starts
Casino --> CasinoAccountManager : uses
Casino --> GameInterface : runs selected game
CasinoAccountManager --> CasinoAccount : creates/gets

GameInterface <|.. SlotsGame
GameInterface <|.. NumberGuessGame
GameInterface <|.. BlackjackGame

PlayerInterface <|.. SlotsPlayer
PlayerInterface <|.. NumberGuessPlayer
PlayerInterface <|.. BlackjackPlayer

SlotsGame o--> SlotsPlayer : add/remove players
NumberGuessGame o--> NumberGuessPlayer : add/remove players
BlackjackGame o--> BlackjackPlayer : add/remove players

SlotsPlayer --> CasinoAccount : has account
NumberGuessPlayer --> CasinoAccount : has account
BlackjackPlayer --> CasinoAccount : has account

BlackjackGame --> Deck : uses
BlackjackGame --> BlackjackHand : dealer hand
BlackjackPlayer --> BlackjackHand : player hand
Deck o--> Card : contains
BlackjackHand o--> Card : contains
```
261 changes: 182 additions & 79 deletions src/main/java/com/github/zipcodewilmington/Casino.java
Original file line number Diff line number Diff line change
@@ -1,79 +1,182 @@
package com.github.zipcodewilmington;

import com.github.zipcodewilmington.casino.CasinoAccount;
import com.github.zipcodewilmington.casino.CasinoAccountManager;
import com.github.zipcodewilmington.casino.GameInterface;
import com.github.zipcodewilmington.casino.PlayerInterface;
import com.github.zipcodewilmington.casino.games.numberguess.NumberGuessGame;
import com.github.zipcodewilmington.casino.games.numberguess.NumberGuessPlayer;
import com.github.zipcodewilmington.casino.games.slots.SlotsGame;
import com.github.zipcodewilmington.casino.games.slots.SlotsPlayer;
import com.github.zipcodewilmington.utils.AnsiColor;
import com.github.zipcodewilmington.utils.IOConsole;

/**
* Created by leon on 7/21/2020.
*/
public class Casino implements Runnable {
private final IOConsole console = new IOConsole(AnsiColor.BLUE);

@Override
public void run() {
String arcadeDashBoardInput;
CasinoAccountManager casinoAccountManager = new CasinoAccountManager();
do {
arcadeDashBoardInput = getArcadeDashboardInput();
if ("select-game".equals(arcadeDashBoardInput)) {
String accountName = console.getStringInput("Enter your account name:");
String accountPassword = console.getStringInput("Enter your account password:");
CasinoAccount casinoAccount = casinoAccountManager.getAccount(accountName, accountPassword);
boolean isValidLogin = casinoAccount != null;
if (isValidLogin) {
String gameSelectionInput = getGameSelectionInput().toUpperCase();
if (gameSelectionInput.equals("SLOTS")) {
play(new SlotsGame(), new SlotsPlayer());
} else if (gameSelectionInput.equals("NUMBERGUESS")) {
play(new NumberGuessGame(), new NumberGuessPlayer());
} else {
// TODO - implement better exception handling
String errorMessage = "[ %s ] is an invalid game selection";
throw new RuntimeException(String.format(errorMessage, gameSelectionInput));
}
} else {
// TODO - implement better exception handling
String errorMessage = "No account found with name of [ %s ] and password of [ %s ]";
throw new RuntimeException(String.format(errorMessage, accountPassword, accountName));
}
} else if ("create-account".equals(arcadeDashBoardInput)) {
console.println("Welcome to the account-creation screen.");
String accountName = console.getStringInput("Enter your account name:");
String accountPassword = console.getStringInput("Enter your account password:");
CasinoAccount newAccount = casinoAccountManager.createAccount(accountName, accountPassword);
casinoAccountManager.registerAccount(newAccount);
}
} while (!"logout".equals(arcadeDashBoardInput));
}

private String getArcadeDashboardInput() {
return console.getStringInput(new StringBuilder()
.append("Welcome to the Arcade Dashboard!")
.append("\nFrom here, you can select any of the following options:")
.append("\n\t[ create-account ], [ select-game ]")
.toString());
}

private String getGameSelectionInput() {
return console.getStringInput(new StringBuilder()
.append("Welcome to the Game Selection Dashboard!")
.append("\nFrom here, you can select any of the following options:")
.append("\n\t[ SLOTS ], [ NUMBERGUESS ]")
.toString());
}

private void play(Object gameObject, Object playerObject) {
GameInterface game = (GameInterface)gameObject;
PlayerInterface player = (PlayerInterface)playerObject;
game.add(player);
game.run();
}
}
package com.github.zipcodewilmington;

import com.github.zipcodewilmington.casino.CasinoAccount;
import com.github.zipcodewilmington.casino.CasinoAccountManager;
import com.github.zipcodewilmington.casino.GameInterface;
import com.github.zipcodewilmington.casino.PlayerInterface;
import com.github.zipcodewilmington.casino.games.blackjack.BlackjackGame;
import com.github.zipcodewilmington.casino.games.blackjack.BlackjackPlayer;
import com.github.zipcodewilmington.casino.games.craps.CrapsGame;
import com.github.zipcodewilmington.casino.games.craps.CrapsPlayer;
import com.github.zipcodewilmington.casino.games.hangman.HangmanGame;
import com.github.zipcodewilmington.casino.games.hangman.HangmanPlayer;
import com.github.zipcodewilmington.casino.games.numberguess.NumberGuessGame;
import com.github.zipcodewilmington.casino.games.numberguess.NumberGuessPlayer;
import com.github.zipcodewilmington.casino.games.roulette.RouletteGame;
import com.github.zipcodewilmington.casino.games.roulette.RoulettePlayer;
import com.github.zipcodewilmington.casino.games.slots.SlotsGame;
import com.github.zipcodewilmington.casino.games.slots.SlotsPlayer;
import com.github.zipcodewilmington.utils.AnsiColor;
import com.github.zipcodewilmington.utils.IOConsole;

/**
* Created by leon on 7/21/2020.
*/
public class Casino implements Runnable {
private final IOConsole console = new IOConsole(AnsiColor.BLUE);

@Override
public void run() {
String arcadeDashBoardInput;
CasinoAccountManager casinoAccountManager = new CasinoAccountManager();
CasinoAccount currentAccount = null;
do {
arcadeDashBoardInput = getArcadeDashboardInput(currentAccount);
if ("2".equals(arcadeDashBoardInput)) {
if (currentAccount == null) {
String accountName = console.getStringInput("Enter your account name:");
String accountPassword = console.getStringInput("Enter your account password:");
currentAccount = casinoAccountManager.getAccount(accountName, accountPassword);
if (currentAccount == null) {
console.println("No account found with name of [ %s ] and password of [ %s ]", accountName, accountPassword);
continue;
}
}
String gameSelectionInput;
do {
gameSelectionInput = getGameSelectionInput().toUpperCase();
if (gameSelectionInput.equals("1")) {
play(new SlotsGame(), new SlotsPlayer(currentAccount.getUsername(), currentAccount));
} else if (gameSelectionInput.equals("2")) {
play(new NumberGuessGame(), new NumberGuessPlayer(currentAccount));
} else if (gameSelectionInput.equals("3")) {
play(new BlackjackGame(), new BlackjackPlayer(currentAccount));
} else if (gameSelectionInput.equals("4")) {
play(new CrapsGame(), new CrapsPlayer(currentAccount));
} else if (gameSelectionInput.equals("5")) {
play(new RouletteGame(), new RoulettePlayer(currentAccount));
} else if (gameSelectionInput.equals("6")) {
play(new HangmanGame(), new HangmanPlayer(currentAccount.getUsername(), currentAccount));
} else if (!gameSelectionInput.equals("7")) {
console.println("[ %s ] is an invalid game selection", gameSelectionInput);
}
} while (!gameSelectionInput.equals("7") && currentAccount.getBalance() > 0);

if (currentAccount.getBalance() <= 0) {
console.println(
"\n" +
" _____ _____ _____ _ _ \n" +
" |_ _||_ _|| ___|| \\ | |\n" +
" | | | | | |_ | \\| |\n" +
" | | | | | _| | |\\ |\n" +
" |_| |_| |_| |_| \\_|\n" +
"\n" +
" __ __ ___ _ _ _ ____ _____ \n" +
" \\ \\/ / / _ \\| | | | / \\ | _ \\| ____|\n" +
" \\ / | | | | | | | / _ \\| |_) | _| \n" +
" / / | |_| | |_| | / ___ \\| _ <| |___\n" +
" /_/ \\___/ \\___/ /_/ \\_\\_| \\_\\_____|\n" +
"\n" +
" ____ ____ ___ _ __ _____\n" +
" | __ )| _ \\/ _ \\| |/ /| ____|\n" +
" | _ \\| |_) | | | | ' /| _| \n" +
" | |_) | _ <| |_| | . \\| |___\n" +
" |____/|_| \\_\\\\___/|_|\\_\\|_____|\n" +
"\n" +
" +------------------------------------------+\n" +
" | Ta Ta For Now... and your money too! |\n" +
" | The house ALWAYS wins! >:) |\n" +
" +------------------------------------------+\n"
);
}
} else if ("1".equals(arcadeDashBoardInput)) {
console.println("Welcome to the account-creation screen.");
String accountName = console.getStringInput("Enter your account name:");
String accountPassword = console.getStringInput("Enter your account password:");
CasinoAccount newAccount = casinoAccountManager.createAccount(accountName, accountPassword);
casinoAccountManager.registerAccount(newAccount);
console.println("Account created! You have been given $500.00 to start.");
} else if ("3".equals(arcadeDashBoardInput)) {
if (currentAccount == null) {
String accountName = console.getStringInput("Enter your account name:");
String accountPassword = console.getStringInput("Enter your account password:");
currentAccount = casinoAccountManager.getAccount(accountName, accountPassword);
if (currentAccount == null) {
console.println("No account found with name of [ %s ] and password of [ %s ]", accountName, accountPassword);
continue;
}
}
manageAccount(currentAccount);
} else if ("4".equals(arcadeDashBoardInput)) {
if (currentAccount != null) {
console.println("Logged out of [ %s ].", currentAccount.getUsername());
currentAccount = null;
arcadeDashBoardInput = ""; // don't exit, just log out
}
}
} while (!"5".equals(arcadeDashBoardInput));
}



private String getArcadeDashboardInput(CasinoAccount currentAccount) {
StringBuilder sb = new StringBuilder()
.append("\n ╔══════════════════════════════╗")
.append("\n║ 🎰 WELCOME TO CASINO 🎰 ║");
if (currentAccount != null) {
sb.append(String.format("\n║ Logged in: %-17s║", currentAccount.getUsername()));
}
sb.append("\n╠══════════════════════════════╣")
.append("\n║ 1. Create Account ║")
.append("\n║ 2. Select Game ║")
.append("\n║ 3. Manage Account ║")
.append("\n║ 4. Logout ║")
.append("\n║ 5. Exit ║")
.append("\n╚══════════════════════════════╝")
.append("\nEnter a number (1-5): ");
return console.getStringInput(sb.toString());
}

private String getGameSelectionInput() {
return console.getStringInput(new StringBuilder()
.append("\n ╔══════════════════════════════╗")
.append("\n║ GAME SELECTION DASHBOARD ║")
.append("\n╠══════════════════════════════╣")
.append("\n║ 1. SLOTS ║")
.append("\n║ 2. NUMBER GUESS ║")
.append("\n║ 3. BLACKJACK ║")
.append("\n║ 4. CRAPS ║")
.append("\n║ 5. ROULETTE ║")
.append("\n║ 6. HANGMAN ║")
.append("\n║ 7. Back ║")
.append("\n╚══════════════════════════════╝")
.append("\nEnter a number (1-7): ")
.toString());
}

private void manageAccount(CasinoAccount account) {
String input;
do {
input = console.getStringInput(new StringBuilder()
.append("\n=== Account: " + account.getUsername() + " ===")
.append("\n\t[ view ], [ deposit ], [ withdraw ], [ back ]")
.toString());

if ("view".equals(input)) {
console.println("Username: %s", account.getUsername());
account.displayBalance();
} else if ("deposit".equals(input)) {
double amount = console.getDoubleInput("Enter deposit amount: $");
account.depositToBalance(amount);
} else if ("withdraw".equals(input)) {
double amount = console.getDoubleInput("Enter withdrawal amount: $");
account.withdrawBalance(amount);
}
} while (!"back".equals(input));
}

private void play(GameInterface game, PlayerInterface player) {
game.add(player);
game.run();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ public class MainApplication {
public static void main(String[] args) {
new Casino().run();
}
}
}
Loading