diff --git a/src/main/java/com/github/zipcodewilmington/casino/CasinoAccount.java b/src/main/java/com/github/zipcodewilmington/casino/CasinoAccount.java index 654c749b4..a220def9e 100644 --- a/src/main/java/com/github/zipcodewilmington/casino/CasinoAccount.java +++ b/src/main/java/com/github/zipcodewilmington/casino/CasinoAccount.java @@ -6,4 +6,56 @@ * The `ArcadeAccount` is used to log into the system to select a `Game` to play. */ public class CasinoAccount { + + String username; + String password; + Integer age; + Double balance; + + public CasinoAccount(String username, String password, Integer age, Double balance) { + this.username = username; + this.password = password; + this.age = age; + this.balance = balance; + } + + public String getUsername() { + return username; + } + + public void resetUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void resetPassword(String password) { + this.password = password; + } + + public Integer getAge() { + return age; + } + + public void ageIncreased() { + age++; + } + + public Double getBalance() { + return balance; + } + + public void setBalance(Double balance) { + this.balance = balance; + } + + public void addToBalance(Integer amountToAdd) { + balance += amountToAdd; + } + + public void reduceBalance(Integer amountToReduce) { + balance -= amountToReduce; + } } diff --git a/src/main/java/com/github/zipcodewilmington/casino/PlayerInterface.java b/src/main/java/com/github/zipcodewilmington/casino/PlayerInterface.java index c50b5113b..cb71d22dd 100644 --- a/src/main/java/com/github/zipcodewilmington/casino/PlayerInterface.java +++ b/src/main/java/com/github/zipcodewilmington/casino/PlayerInterface.java @@ -15,7 +15,6 @@ public interface PlayerInterface { /** * Defines how a specific implementation of `PlayerInterface` plays their respective game. * @param specify any return type you would like here - * @return whatever return value you would like */ - SomeReturnType play(); + void play(); } diff --git a/src/main/java/com/github/zipcodewilmington/casino/games/CardGame/BlackJack.java b/src/main/java/com/github/zipcodewilmington/casino/games/CardGame/BlackJack.java new file mode 100644 index 000000000..85e09267f --- /dev/null +++ b/src/main/java/com/github/zipcodewilmington/casino/games/CardGame/BlackJack.java @@ -0,0 +1,21 @@ +package com.github.zipcodewilmington.casino.games.CardGame; + +import com.github.zipcodewilmington.casino.GameInterface; +import com.github.zipcodewilmington.casino.PlayerInterface; + +public class BlackJack implements GameInterface { + @Override + public void add(PlayerInterface player) { + + } + + @Override + public void remove(PlayerInterface player) { + + } + + @Override + public void run() { + + } +} diff --git a/src/main/java/com/github/zipcodewilmington/casino/games/CardGame/Card.java b/src/main/java/com/github/zipcodewilmington/casino/games/CardGame/Card.java new file mode 100644 index 000000000..006fe860a --- /dev/null +++ b/src/main/java/com/github/zipcodewilmington/casino/games/CardGame/Card.java @@ -0,0 +1,36 @@ +package com.github.zipcodewilmington.casino.games.CardGame; + +public class Card{ + FaceValueOfCard faceValueOfCard; + Suit suit; + public Card(){ + + } + public Card(FaceValueOfCard value, Suit suit){ + this.faceValueOfCard=value; + this.suit=suit; + } + + public FaceValueOfCard getFaceValueOfCard() { + return faceValueOfCard; + } + + public void setFaceValueOfCard(FaceValueOfCard faceValueOfCard) { + this.faceValueOfCard = faceValueOfCard; + } + + public Suit getSuit() { + return suit; + } + public String getFaceValueAndSuit() { + StringBuilder sb = new StringBuilder(); + sb.append(faceValueOfCard+"-"+suit); + sb.append("\n"); + return sb.toString(); + } + + public void setSuit(Suit suit) { + this.suit = suit; + } +} + diff --git a/src/main/java/com/github/zipcodewilmington/casino/games/CardGame/CardHand.java b/src/main/java/com/github/zipcodewilmington/casino/games/CardGame/CardHand.java new file mode 100644 index 000000000..bc6e05b0a --- /dev/null +++ b/src/main/java/com/github/zipcodewilmington/casino/games/CardGame/CardHand.java @@ -0,0 +1,24 @@ +package com.github.zipcodewilmington.casino.games.CardGame; +import java.util.ArrayList; +import java.util.Comparator; + +public class CardHand{ + ArrayList userHand = new ArrayList(); + public CardHand(ArrayList dealtCards){ + userHand.addAll(dealtCards); + } + + public String displayHand() { + + userHand.sort(Comparator.comparing(Card::getFaceValueOfCard)); + StringBuilder sb = new StringBuilder(); + for (Card card: userHand + ) { sb.append(card.getFaceValueAndSuit()); + } + return sb.toString(); + } + + + +} + diff --git a/src/main/java/com/github/zipcodewilmington/casino/games/CardGame/CasinoWar.java b/src/main/java/com/github/zipcodewilmington/casino/games/CardGame/CasinoWar.java new file mode 100644 index 000000000..f77f9f11e --- /dev/null +++ b/src/main/java/com/github/zipcodewilmington/casino/games/CardGame/CasinoWar.java @@ -0,0 +1,90 @@ +package com.github.zipcodewilmington.casino.games.CardGame; +import com.github.zipcodewilmington.casino.GameInterface; +import com.github.zipcodewilmington.casino.PlayerInterface; +import com.github.zipcodewilmington.utils.IOConsole; + +public class CasinoWar extends Deck implements GameInterface { + + CardHand playerHand; + CardHand dealerHand; + Deck deck = new Deck(1); + + public CasinoWar(int numberOfDecks) { + super(numberOfDecks); + } + + public CasinoWar() { + super(); + } + + public void playCasinoWarHands() { + IOConsole input = new IOConsole(); + Deck warDeck = new Deck(1); + warDeck.shuffle(); + input.println("Welcome to Casino Wars!!!!"); + do { + + Integer i = input.getIntegerInput("Do you want to pick a card? - Yes 1. No 2."); + if (i == 1) { + playerHand = new CardHand(warDeck.dealCards(1)); + dealerHand = new CardHand(warDeck.dealCards(1)); + input.println("Player hand is " + playerHand.userHand.get(0).faceValueOfCard.getCardIntegerValue()); + input.println("Dealer hand is " + dealerHand.userHand.get(0).faceValueOfCard.getCardIntegerValue()); + if (playerWins().equals("playerwon")) { + input.println("Congratulations!!! You won!!"); + } else if(playerWins().equals("dealerwon")) { + input.println("So sad, you lost!!"); + }else + { + input.println("Its a tie!! Draw another card!"); + } + } else{ + return; + } + } + while (true); + } + + public String playerWins() { + String result = "playerwon"; + //Integer play = playerHand.userHand.get(0).faceValueOfCard.getCardIntegerValue(); + if (playerHand.userHand.get(0).faceValueOfCard.getCardIntegerValue() < + dealerHand.userHand.get(0).faceValueOfCard.getCardIntegerValue()) { + result = "dealerwon"; + } + else if(playerHand.userHand.get(0).faceValueOfCard.getCardIntegerValue() == + dealerHand.userHand.get(0).faceValueOfCard.getCardIntegerValue()){ + result = "tie"; + } + return result; + } + + @Override + public void add(PlayerInterface player) { + + } + + @Override + public void remove(PlayerInterface player) { + + } + + @Override + public void run() { + + } + + +// public Boolean tieBetweenPlayerAndDealer() { +// Boolean result = playerWins(); +// if (playerHand.userHand.get(0).faceValueOfCard.getCardIntegerValue() == +// dealerHand.userHand.get(0).faceValueOfCard.getCardIntegerValue()) { +// result = playerWins(); +// } +// return result; +// } + +} + + + diff --git a/src/main/java/com/github/zipcodewilmington/casino/games/CardGame/Deck.java b/src/main/java/com/github/zipcodewilmington/casino/games/CardGame/Deck.java new file mode 100644 index 000000000..59231aff6 --- /dev/null +++ b/src/main/java/com/github/zipcodewilmington/casino/games/CardGame/Deck.java @@ -0,0 +1,67 @@ +package com.github.zipcodewilmington.casino.games.CardGame; +import com.github.zipcodewilmington.casino.games.CardGame.Card; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Stack; + +public class Deck { + Stack cardDeck = new Stack<>(); + + + public Deck(int numberOfDecks) { + for (int index = 0; index < numberOfDecks; index++) { + for (FaceValueOfCard value : FaceValueOfCard.values()) { + for (Suit cardSuit : Suit.values()) { + + Card card = new Card(value, cardSuit); + this.cardDeck.add(card); + } + + } + Collections.shuffle(cardDeck); + } + } + + public Deck() { + + } + + public void shuffle() { + Collections.shuffle(cardDeck); + } + + public Integer getSize() { + return cardDeck.size(); + } + + public ArrayList dealCards(int numberOfCards) { + + ArrayList dealingCards = new ArrayList(); + + for (int index = 0; index < numberOfCards; index++) { + dealingCards.add(cardDeck.pop()); + } + return dealingCards; + } + + + public Card drawCard() { + if (!cardDeck.isEmpty()) { + Card drawnCard = cardDeck.pop(); + return drawnCard; + + } else + System.out.println("Deck is empty"); + + return null; + } + + public void setDeck(Stack cardDeck) { + this.cardDeck = cardDeck; + } + + public Stack getDeck() { + return cardDeck; + } + +} \ No newline at end of file diff --git a/src/main/java/com/github/zipcodewilmington/casino/games/CardGame/FaceValueOfCard.java b/src/main/java/com/github/zipcodewilmington/casino/games/CardGame/FaceValueOfCard.java new file mode 100644 index 000000000..dffa11c47 --- /dev/null +++ b/src/main/java/com/github/zipcodewilmington/casino/games/CardGame/FaceValueOfCard.java @@ -0,0 +1,16 @@ +package com.github.zipcodewilmington.casino.games.CardGame; + +public enum FaceValueOfCard { + TWO(2), THREE(3), FOUR(4), FIVE(5), SIX(6), SEVEN(7), EIGHT(8), NINE(9), TEN(10), JACK(10), QUEEN(10), KING(10), ACE(11); + + private Integer faceValueOfCard; + + FaceValueOfCard(Integer faceValueOfCard) { + this.faceValueOfCard =faceValueOfCard ; + } + public Integer getCardIntegerValue() { + return faceValueOfCard; + } + +} + diff --git a/src/main/java/com/github/zipcodewilmington/casino/games/CardGame/Suit.java b/src/main/java/com/github/zipcodewilmington/casino/games/CardGame/Suit.java new file mode 100644 index 000000000..f5a1a0f10 --- /dev/null +++ b/src/main/java/com/github/zipcodewilmington/casino/games/CardGame/Suit.java @@ -0,0 +1,6 @@ +package com.github.zipcodewilmington.casino.games.CardGame; + +public enum Suit { + Heart,Diamond,Clubs,Spades; +} + diff --git a/src/main/java/com/github/zipcodewilmington/casino/games/CrapsGame/CrapsGame.java b/src/main/java/com/github/zipcodewilmington/casino/games/CrapsGame/CrapsGame.java new file mode 100644 index 000000000..097151e6d --- /dev/null +++ b/src/main/java/com/github/zipcodewilmington/casino/games/CrapsGame/CrapsGame.java @@ -0,0 +1,71 @@ +package com.github.zipcodewilmington.casino.games.CrapsGame; + +import com.github.zipcodewilmington.casino.GameInterface; +import com.github.zipcodewilmington.casino.PlayerInterface; +import com.github.zipcodewilmington.utils.AnsiColor; +import com.github.zipcodewilmington.utils.IOConsole; + +import java.io.Console; + +public class CrapsGame implements GameInterface { + Dice dice = new Dice(); + int num1; + int num2; + boolean x; +IOConsole console = new IOConsole(AnsiColor.PURPLE); + public int firstRoll() { + num1 = dice.rollingTheDice(); + + console.println("Your first roll is " + num1 + "!"); + return num1; + } + + public int secondRoll() { + num2 = dice.rollingTheDice(); + + console.println("Your second roll is " + num2 + "!"); + return num2; + } + + public boolean sumOfRoll(int num1, int num2) { + boolean x; + if (num1==7||num1==11){ + if(num2==7||num2==11) + return true; console.println("Cash Out! You've won!");} + if(num1!=11&&num1!=7){ + if(num2!=11&&num2!=7) + return true; + }console.println("Turn in your chips... Better luck next time!"); return false; + } + + @Override + public void add(PlayerInterface player) { + + + } + + @Override + public void remove(PlayerInterface player) { + + } + + @Override + public void run() { + IOConsole console = new IOConsole(AnsiColor.PURPLE); + int input = 0; + CrapsGame craps = new CrapsGame(); + + while(input==1){ + console.println("Welcome to the Craps Table!"); + input = console.getIntegerInput("Press 1 to roll or press 2 to quit"); + + int num1=craps.firstRoll(); + int num2=craps.secondRoll(); + craps.sumOfRoll(num1, num2); + + } + + } +} + + diff --git a/src/main/java/com/github/zipcodewilmington/casino/games/CrapsGame/CrapsPlayer.java b/src/main/java/com/github/zipcodewilmington/casino/games/CrapsGame/CrapsPlayer.java new file mode 100644 index 000000000..19d5856c2 --- /dev/null +++ b/src/main/java/com/github/zipcodewilmington/casino/games/CrapsGame/CrapsPlayer.java @@ -0,0 +1,17 @@ +package com.github.zipcodewilmington.casino.games.CrapsGame; + +import com.github.zipcodewilmington.casino.CasinoAccount; +import com.github.zipcodewilmington.casino.PlayerInterface; + +public class CrapsPlayer implements PlayerInterface { + + @Override + public CasinoAccount getArcadeAccount() { + return null; + } + + @Override + public void play() { + + } +} diff --git a/src/main/java/com/github/zipcodewilmington/casino/games/CrapsGame/Dice.java b/src/main/java/com/github/zipcodewilmington/casino/games/CrapsGame/Dice.java new file mode 100644 index 000000000..63516ac11 --- /dev/null +++ b/src/main/java/com/github/zipcodewilmington/casino/games/CrapsGame/Dice.java @@ -0,0 +1,25 @@ +package com.github.zipcodewilmington.casino.games.CrapsGame; + +public class Dice { + int dice; + int die1; + int die2; + + public Dice(){ + dice=0; + die2=0; + die1=0; + } + public int dieNumOne(){ + die1=(int)(Math.random()*6+1); + return die1; + } + public int dieNumTwo(){ + die2=(int)(Math.random()*6+1); + return die2; + } + public int rollingTheDice(){ + dice=dieNumOne()+dieNumTwo(); + return dice; + } +} diff --git a/src/main/java/com/github/zipcodewilmington/casino/games/RandomNumberGenerator.java b/src/main/java/com/github/zipcodewilmington/casino/games/RandomNumberGenerator.java new file mode 100644 index 000000000..3f37eb3f8 --- /dev/null +++ b/src/main/java/com/github/zipcodewilmington/casino/games/RandomNumberGenerator.java @@ -0,0 +1,33 @@ +package com.github.zipcodewilmington.casino.games; + +import java.util.HashSet; +import java.util.Set; + +public abstract class RandomNumberGenerator { + + Integer maxNumber; + Integer minNumber; + Integer amountOfNumbers; + + public RandomNumberGenerator(Integer minNumber, Integer maxNumber, Integer amountOfNumbers) { + this.minNumber = minNumber; + this.maxNumber = maxNumber; + this.amountOfNumbers = amountOfNumbers; + } + + public Integer generateRandomNumber() { + Integer range = (maxNumber - minNumber) + 1; + return (int)(Math.random() * range) + minNumber; + } + + public Set generateRandomNumbers() { + Integer range = (maxNumber - minNumber) + 1; + Set setOfNumbers = new HashSet<>(); + Integer randomNumber = 0; + while (setOfNumbers.size() < amountOfNumbers) { + randomNumber = (int)(Math.random() * range) + minNumber; + setOfNumbers.add(randomNumber); + } + return setOfNumbers; + } +} diff --git a/src/main/java/com/github/zipcodewilmington/casino/games/keno/KenoGame.java b/src/main/java/com/github/zipcodewilmington/casino/games/keno/KenoGame.java new file mode 100644 index 000000000..7940509ce --- /dev/null +++ b/src/main/java/com/github/zipcodewilmington/casino/games/keno/KenoGame.java @@ -0,0 +1,86 @@ +package com.github.zipcodewilmington.casino.games.keno; + +import com.github.zipcodewilmington.casino.CasinoAccount; +import com.github.zipcodewilmington.casino.GameInterface; +import com.github.zipcodewilmington.casino.PlayerInterface; +import com.github.zipcodewilmington.casino.games.RandomNumberGenerator; +import com.github.zipcodewilmington.utils.AnsiColor; +import com.github.zipcodewilmington.utils.IOConsole; + +import java.util.HashSet; +import java.util.Set; + +public class KenoGame extends RandomNumberGenerator implements GameInterface { + + IOConsole console = new IOConsole(AnsiColor.CYAN); + Set players = new HashSet<>(); + Set randomNumbers = generateRandomNumbers(); + Integer playerNumber = 1; + + public KenoGame() { + super(1,80, 20); + } + + @Override + public void add(PlayerInterface player) { + players.add((KenoPlayer) player); + } + + @Override + public void remove(PlayerInterface player) { + players.remove(player); + } + + @Override + public void run() { + Integer count = 1; + for (KenoPlayer kenoPlayer : players) { + kenoPlayer.play(); + } + for (KenoPlayer kenoPlayer : players) { + console.println("Congratulations Player #%s! %s", count, kenoPlayer.chosenNumbers); + kenoPlayer.outcomeOfGame(kenoPlayer.amountToBet); + kenoPlayer.casinoAccount.addToBalance(kenoPlayer.prizeMoney); + count++; + } + console.println("Keno Board: %s", randomNumbers); + } + + public KenoPlayer getPlayer(String playerUsername) { + for (KenoPlayer player : players) { + if (player.getArcadeAccount().getUsername().equals(playerUsername)) { + return player; + } + } + return null; + } + + public Set getPlayers() { + return players; + } + + public Set getChosenNumbers() { + Integer count = 1; + Set chosenNumbers = new HashSet<>(); + console.println("Input 10 numbers between 1 and 80"); + while (chosenNumbers.size() < 10) { + Integer numberInput = console.getIntegerInput("Player #%s numbers: %s\nInput number #%s",playerNumber, chosenNumbers, count); + if (chosenNumbers.contains(numberInput)) { + console.println("Number has already been chosen"); + } + else if (numberInput < 1 || numberInput > 80) { + console.println("That is not a valid number to chose"); + } + else { + chosenNumbers.add(numberInput); + count++; + } + } + playerNumber++; + return chosenNumbers; + } + + public Integer getBet() { + return console.getIntegerInput("How much do you want to bet?"); + } +} diff --git a/src/main/java/com/github/zipcodewilmington/casino/games/keno/KenoPlayer.java b/src/main/java/com/github/zipcodewilmington/casino/games/keno/KenoPlayer.java new file mode 100644 index 000000000..bee719c86 --- /dev/null +++ b/src/main/java/com/github/zipcodewilmington/casino/games/keno/KenoPlayer.java @@ -0,0 +1,101 @@ +package com.github.zipcodewilmington.casino.games.keno; + +import com.github.zipcodewilmington.casino.CasinoAccount; +import com.github.zipcodewilmington.casino.PlayerInterface; +import com.github.zipcodewilmington.utils.IOConsole; + +import java.util.Set; + +public class KenoPlayer implements PlayerInterface { + + IOConsole console = new IOConsole(); + CasinoAccount casinoAccount; + KenoGame gameCurrentlyPlaying; + Integer amountToBet; + Integer prizeMoney; + Set chosenNumbers; + + public KenoPlayer(CasinoAccount casinoAccount, KenoGame gameCurrentlyPlaying) { + this.casinoAccount = casinoAccount; + this.gameCurrentlyPlaying = gameCurrentlyPlaying; + } + + @Override + public CasinoAccount getArcadeAccount() { + return casinoAccount; + } + + @Override + public void play() { + chosenNumbers = gameCurrentlyPlaying.getChosenNumbers(); + checkHowManyMatch(); + amountToBet = gameCurrentlyPlaying.getBet(); + casinoAccount.reduceBalance(amountToBet); + } + + public Integer checkHowManyMatch() { + Integer numberOfMatches = 0; + for (Integer chosenNumber : chosenNumbers) { + if (gameCurrentlyPlaying.randomNumbers.contains(chosenNumber)) { + numberOfMatches++; + } + } + return numberOfMatches; + } + + public Integer outcomeOfGame(Integer amountBet) { + Integer numberOfMatches = checkHowManyMatch(); + switch (numberOfMatches) { + case 1: + console.println("You got 1 match! You win $%s", amountBet * 2); + prizeMoney = amountBet * 2; + return prizeMoney; + + case 2: + console.println("You got 2 matches! You win $%s", amountBet * 5); + prizeMoney = amountBet * 5; + return prizeMoney; + + case 3: + console.println("You got 3 matches! You win $%s", amountBet * 10); + prizeMoney = amountBet * 10; + return prizeMoney; + + case 4: + console.println("You got 4 matches! You win $%s", amountBet * 20); + prizeMoney = amountBet * 20; + return prizeMoney; + + case 5: + console.println("You got 5 matches! You win $%s", amountBet * 40); + prizeMoney = amountBet * 40; + return prizeMoney; + + case 6: + console.println("You got 6 matches! You win $%s", amountBet * 80); + prizeMoney = amountBet * 80; + return prizeMoney; + + case 7: + console.println("You got 7 matches! You win $%s", amountBet * 200); + prizeMoney = amountBet * 200; + return prizeMoney; + + case 8: + console.println("You got 8 matches! You win $%s", amountBet * 500); + prizeMoney = amountBet * 500; + return prizeMoney; + + case 9: + console.println("You got 9 matches! You win $%s", amountBet * 4000); + prizeMoney = amountBet * 4000; + return prizeMoney; + + case 10: + console.println("You got 10 matches! You win $%s", amountBet * 10000); + prizeMoney = amountBet * 10000; + return prizeMoney; + } + return null; + } +} diff --git a/src/main/java/com/github/zipcodewilmington/casino/games/numberguess/NumberGuessGame.java b/src/main/java/com/github/zipcodewilmington/casino/games/numberguess/NumberGuessGame.java index 795709488..cddb02de3 100644 --- a/src/main/java/com/github/zipcodewilmington/casino/games/numberguess/NumberGuessGame.java +++ b/src/main/java/com/github/zipcodewilmington/casino/games/numberguess/NumberGuessGame.java @@ -1,7 +1,44 @@ package com.github.zipcodewilmington.casino.games.numberguess; +import com.github.zipcodewilmington.casino.GameInterface; +import com.github.zipcodewilmington.casino.PlayerInterface; +import com.github.zipcodewilmington.utils.AnsiColor; +import com.github.zipcodewilmington.utils.IOConsole; + +import java.util.Random; + /** * Created by leon on 7/21/2020. */ -public class NumberGuessGame { +public class NumberGuessGame implements GameInterface { + public static void main(String[] args) { + + } + Random random = new Random(); + IOConsole console = new IOConsole(AnsiColor.BLUE); + int guessedNumber = 0; + int randomNumberFromOneToOneHundred = random.nextInt(100) + 1; + + + @Override + public void add(PlayerInterface player) { + } + + @Override + public void remove(PlayerInterface player) { + + } + + @Override + public void run() { + guessedNumber = console.getIntegerInput("Guess a number between 1 and 100"); + while(guessedNumber >= 1 && guessedNumber<=100) { + if (guessedNumber == randomNumberFromOneToOneHundred) { + console.print("Whoa!!! You've won 100 tokens!"); + } else { + console.print("Better luck next time..."); + } + } + + } } \ No newline at end of file diff --git a/src/main/java/com/github/zipcodewilmington/casino/games/numberguess/NumberGuessPlayer.java b/src/main/java/com/github/zipcodewilmington/casino/games/numberguess/NumberGuessPlayer.java index aa5cce2e7..66749fc99 100644 --- a/src/main/java/com/github/zipcodewilmington/casino/games/numberguess/NumberGuessPlayer.java +++ b/src/main/java/com/github/zipcodewilmington/casino/games/numberguess/NumberGuessPlayer.java @@ -1,7 +1,19 @@ package com.github.zipcodewilmington.casino.games.numberguess; +import com.github.zipcodewilmington.casino.CasinoAccount; +import com.github.zipcodewilmington.casino.PlayerInterface; + /** * Created by leon on 7/21/2020. */ -public class NumberGuessPlayer { +public class NumberGuessPlayer implements PlayerInterface { + @Override + public CasinoAccount getArcadeAccount() { + return null; + } + + @Override + public SomeReturnType play() { + return null; + } } \ No newline at end of file diff --git a/src/main/java/com/github/zipcodewilmington/casino/games/roulette/RouletteBoard.java b/src/main/java/com/github/zipcodewilmington/casino/games/roulette/RouletteBoard.java new file mode 100644 index 000000000..04b222f9a --- /dev/null +++ b/src/main/java/com/github/zipcodewilmington/casino/games/roulette/RouletteBoard.java @@ -0,0 +1,28 @@ +package com.github.zipcodewilmington.casino.games.roulette; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class RouletteBoard { + public int ball; + List boardBlack; + List boardRed; + Integer[] red; + Integer[] black; + + public RouletteBoard(){ + + ball= (int)(Math.random()*36+1); + } + public void blackAndRedArrays(){ + List boardBlack = Arrays.asList(black); + List boardRed = Arrays.asList(red); + } + + + + + + +} diff --git a/src/main/java/com/github/zipcodewilmington/casino/games/roulette/RouletteGame.java b/src/main/java/com/github/zipcodewilmington/casino/games/roulette/RouletteGame.java new file mode 100644 index 000000000..8416a415b --- /dev/null +++ b/src/main/java/com/github/zipcodewilmington/casino/games/roulette/RouletteGame.java @@ -0,0 +1,97 @@ +package com.github.zipcodewilmington.casino.games.roulette; + +import com.github.zipcodewilmington.casino.GameInterface; +import com.github.zipcodewilmington.casino.PlayerInterface; +import com.github.zipcodewilmington.utils.AnsiColor; +import com.github.zipcodewilmington.utils.IOConsole; + +import java.util.Arrays; +import java.util.List; + +public class RouletteGame implements GameInterface { + int ball; + Integer[] red; + Integer[] black; + int money; + int bet; + int input; + private PlayerInterface player; + + public RouletteGame() { + ball = (int) (Math.random() * 36 + 1); + red = new Integer[]{1, 3, 5, 7, 9, 12, 14, 16, 18, 19, 21, 23, 25, 27, 30, 32, 34, 36}; + black = new Integer[]{2, 4, 6, 8, 10, 11, 13, 15, 17, 20, 22, 24, 26, 28, 29, 31, 33, 35}; + } + public int choosingABet() { + IOConsole console = new IOConsole(AnsiColor.YELLOW); + console.println("Welcome to The Roulette Table!"); + console.println("Make your bets below <3"); + this.input = console.getIntegerInput("1.(Red) 2.(Black) 3.(Odds) 4.(Evens) 5.(Specific Number)"); + return input; + } + public int theRouletteGame(int input) { + IOConsole console = new IOConsole(AnsiColor.AUTO); + if (input == 1) { + List redNum = Arrays.asList(red); + if (input == 1) { + for (Integer num : redNum) { + if (ball == num) { + money = bet * 2; + } + money = bet - bet; + } + } + + } else if (input == 2) { + List blackNum = Arrays.asList(black); + if (input == 2) { + for (Integer num : blackNum) { + if (ball == num) { + money = bet + bet; + } + money = bet - bet; + } + } + } else if (input == 3) { + if (ball % 2 == 0) { + money = bet - bet; + } + money = bet + bet; + } else if (input == 4) { + if (ball % 2 == 0) { + money = bet + bet; + } + money = bet - bet; + } else if (input == 5) { + int num = 0; + num = console.getIntegerInput("Pick a number between 1-36 that you would like to bet on!"); + if (ball == num) { + money = bet + bet * 2; + } + money = bet - bet; + + }return money; + } + + + + @Override + public void add (PlayerInterface player){ + this.player = player; + + } + + @Override + public void remove (PlayerInterface player){ + this.player = null; + } + + @Override + public void run () { +RouletteGame game = new RouletteGame(); +int input=game.choosingABet(); +int money=game.theRouletteGame(input); + + } + } + diff --git a/src/main/java/com/github/zipcodewilmington/casino/games/roulette/RouletteGamePlayer.java b/src/main/java/com/github/zipcodewilmington/casino/games/roulette/RouletteGamePlayer.java new file mode 100644 index 000000000..8402605f0 --- /dev/null +++ b/src/main/java/com/github/zipcodewilmington/casino/games/roulette/RouletteGamePlayer.java @@ -0,0 +1,18 @@ +package com.github.zipcodewilmington.casino.games.roulette; + +import com.github.zipcodewilmington.casino.CasinoAccount; +import com.github.zipcodewilmington.casino.PlayerInterface; +import com.github.zipcodewilmington.utils.IOConsole; + +public class RouletteGamePlayer implements PlayerInterface { + + @Override + public CasinoAccount getArcadeAccount() { + return null; + } + + @Override + public void play() { + + } +} diff --git a/src/main/java/com/github/zipcodewilmington/casino/games/slots/SlotsGame.java b/src/main/java/com/github/zipcodewilmington/casino/games/slots/SlotsGame.java index 8cb20c787..518f426aa 100644 --- a/src/main/java/com/github/zipcodewilmington/casino/games/slots/SlotsGame.java +++ b/src/main/java/com/github/zipcodewilmington/casino/games/slots/SlotsGame.java @@ -1,7 +1,62 @@ package com.github.zipcodewilmington.casino.games.slots; +import com.fasterxml.jackson.databind.util.ISO8601Utils; +import com.github.zipcodewilmington.casino.GameInterface; +import com.github.zipcodewilmington.casino.PlayerInterface; +import com.github.zipcodewilmington.utils.AnsiColor; +import com.github.zipcodewilmington.utils.IOConsole; + +import java.util.Random; +import java.util.Scanner; + /** * Created by leon on 7/21/2020. */ -public class SlotsGame { +public class SlotsGame implements GameInterface { + public static void main(String[] args) { + + } + + @Override + public void add(PlayerInterface player) { + + } + + @Override + public void remove(PlayerInterface player) { + + } + + @Override + public void run() { + Random generator = new Random(); + IOConsole console = new IOConsole(AnsiColor.BLUE); + String slot1, slot2, slot3; + int input = 0; + // this is where the funds will be added + while(input == 1){ + console.println("Welcome to the Slot Machine!"); + console.println("You need 10 tokens to play!" + "\n"); + + input = console.getIntegerInput("Press 1 to pull or press 2 to quit"); //this will be where the funds are added + + String[] slotValues = {"watermelon", "grape", "lemon", "orange", "bar", "7", "BIGWIN", "cherry","banana"}; + slot1 = slotValues[generator.nextInt(slotValues.length)]; + slot2 = slotValues[generator.nextInt(slotValues.length)]; + slot3 = slotValues[generator.nextInt(slotValues.length)]; + + + console.print(slot1 + " " + slot2 + " " + slot3 + "\n"); + + if (slot1 == "BIG WIN" && slot1 == slot2 && slot1 == slot3) { + console.print("Jackpot! You win 50 tokens!" + "\n"); + } else if (slot1 == slot2 && slot1 == slot3) { + console.print("Congrats! You win 10 tokens." + "\n"); + } else if (slot1 == slot2 || slot1 == slot3 || slot2 == slot3) { + console.print("Congrats! You win 5 tokens." + "\n"); + } else { + console.print("Sorry! Better luck next time." + "\n"); + } + } + } } diff --git a/src/main/java/com/github/zipcodewilmington/casino/games/slots/SlotsPlayer.java b/src/main/java/com/github/zipcodewilmington/casino/games/slots/SlotsPlayer.java index f89ebd7f5..c89640e4f 100644 --- a/src/main/java/com/github/zipcodewilmington/casino/games/slots/SlotsPlayer.java +++ b/src/main/java/com/github/zipcodewilmington/casino/games/slots/SlotsPlayer.java @@ -1,7 +1,20 @@ package com.github.zipcodewilmington.casino.games.slots; +import com.github.zipcodewilmington.casino.CasinoAccount; +import com.github.zipcodewilmington.casino.PlayerInterface; + /** * Created by leon on 7/21/2020. */ -public class SlotsPlayer { +public class SlotsPlayer implements PlayerInterface { + + @Override + public CasinoAccount getArcadeAccount() { + return null; + } + + @Override + public SomeReturnType play() { + return null; + } } \ No newline at end of file diff --git a/src/test/java/NumberGuessGame/NumberGuessPlayerTest.java b/src/test/java/NumberGuessGame/NumberGuessPlayerTest.java new file mode 100644 index 000000000..a42324b67 --- /dev/null +++ b/src/test/java/NumberGuessGame/NumberGuessPlayerTest.java @@ -0,0 +1,4 @@ +package NumberGuessGame; + +public class NumberGuessPlayerTest { +} diff --git a/src/test/java/NumberGuessGame/NumberGuessTest.java b/src/test/java/NumberGuessGame/NumberGuessTest.java new file mode 100644 index 000000000..412bff3e5 --- /dev/null +++ b/src/test/java/NumberGuessGame/NumberGuessTest.java @@ -0,0 +1,38 @@ +package NumberGuessGame; + +import org.junit.Test; + +public class NumberGuessTest { + @Test + public void numberRandomizerTest(){ + //given + + //when + + //then + } + @Test + public void guessedNumberTest(){ + //given + + //when + + //then + } + @Test + public void winnerTest(){ + //given + + //when + + //then + } + @Test + public void loserTest(){ + //given + + //when + + //then + } +} diff --git a/src/test/java/Slots/SlotsPlayerTest.java b/src/test/java/Slots/SlotsPlayerTest.java new file mode 100644 index 000000000..76428bfc6 --- /dev/null +++ b/src/test/java/Slots/SlotsPlayerTest.java @@ -0,0 +1,4 @@ +package Slots; + +public class SlotsPlayerTest { +} diff --git a/src/test/java/Slots/SlotsTest.java b/src/test/java/Slots/SlotsTest.java new file mode 100644 index 000000000..9991e0d13 --- /dev/null +++ b/src/test/java/Slots/SlotsTest.java @@ -0,0 +1,95 @@ +package Slots; + +import com.github.zipcodewilmington.casino.games.slots.SlotsGame; +import org.junit.Assert; +import org.junit.Test; + +import java.util.Random; +import java.util.Scanner; + +public class SlotsTest { + @Test + public void winnerTest(){ + //given + String slot1 = "cherry"; + String slot2 = "cherry"; + String slot3 = "cherry"; + if (slot1 == "BIG WIN" && slot1 == slot2 && slot1 == slot3) { + System.out.println("Jackpot! You win 50 tokens!" + "\n"); + } else if (slot1 == slot2 && slot1 == slot3) { + System.out.println("Congrats! You win 10 tokens." + "\n"); + } else if (slot1 == slot2 || slot1 == slot3 || slot2 == slot3) { + System.out.println("Congrats! You win 5 tokens." + "\n"); + } else { + System.out.println("Sorry! Better luck next time." + "\n"); + } + //when + + String expected = "Congrats! You win 10 tokens." + "\n"; + if(slot1 == slot2 && slot1 == slot3){ + System.out.println(expected); + } + + + + //then + Assert.assertTrue(expected,true); + + } + @Test + public void loserTest(){ + //given + String slot1 = "cherry"; + String slot2 = "7"; + String slot3 = "BIGWIN"; + if (slot1 == "BIG WIN" && slot1 == slot2 && slot1 == slot3) { + System.out.println("Jackpot! You win 50 tokens!" + "\n"); + } else if (slot1 == slot2 && slot1 == slot3) { + System.out.println("Congrats! You win 10 tokens." + "\n"); + } else if (slot1 == slot2 || slot1 == slot3 || slot2 == slot3) { + System.out.println("Congrats! You win 5 tokens." + "\n"); + } else { + System.out.println("Sorry! Better luck next time." + "\n"); + } + //when + + String expected = "Sorry! Better luck next time." + "\n"; + if(!slot1.equals(slot2) || !slot1.equals(slot3)){ + System.out.println(expected); + } + + + + //then + Assert.assertTrue(expected,true); + } + @Test + public void partialWin(){ + //given + String slot1 = "cherry"; + String slot2 = "7"; + String slot3 = "7"; + if (slot1 == "BIG WIN" && slot1 == slot2 && slot1 == slot3) { + System.out.println("Jackpot! You win 50 tokens!" + "\n"); + } else if (slot1 == slot2 && slot1 == slot3) { + System.out.println("Congrats! You win 10 tokens." + "\n"); + } else if (slot1 == slot2 || slot1 == slot3 || slot2 == slot3) { + System.out.println("Congrats! You win 5 tokens." + "\n"); + } else { + System.out.println("Sorry! Better luck next time." + "\n"); + } + //when + + String expected = "Congrats! You win 5 tokens.\" + \"\\n"; + if(!slot1.equals(slot2) || !slot1.equals(slot3)){ + System.out.println(expected); + } + + + + //then + Assert.assertTrue(expected,true); + } + + +} diff --git a/src/test/java/com/github/zipcodewilmington/casino/CasinoAccountTest.java b/src/test/java/com/github/zipcodewilmington/casino/CasinoAccountTest.java new file mode 100644 index 000000000..0517b7704 --- /dev/null +++ b/src/test/java/com/github/zipcodewilmington/casino/CasinoAccountTest.java @@ -0,0 +1,4 @@ +package com.github.zipcodewilmington.casino; + +public class CasinoAccountTest { +} diff --git a/src/test/java/com/github/zipcodewilmington/casino/games/Craps/CrapsTest.java b/src/test/java/com/github/zipcodewilmington/casino/games/Craps/CrapsTest.java new file mode 100644 index 000000000..de8a948e6 --- /dev/null +++ b/src/test/java/com/github/zipcodewilmington/casino/games/Craps/CrapsTest.java @@ -0,0 +1,78 @@ +package com.github.zipcodewilmington.casino.games.Craps; + + +import com.github.zipcodewilmington.casino.games.CrapsGame.CrapsGame; + +import com.github.zipcodewilmington.casino.games.CrapsGame.Dice; +import org.junit.Assert; +import org.junit.Test; + + +public class CrapsTest { + + @Test + public void firstRollTest(){ + //given + CrapsGame game = new CrapsGame(); + int expected=0; + //when + int actual= game.firstRoll(); + + //then + Assert.assertNotEquals(expected, actual); + } + + @Test + public void secondRollTest(){ + //given + CrapsGame game = new CrapsGame(); + int expected=0; + //when + int actual= game.secondRoll(); + + //then + Assert.assertNotEquals(expected, actual); + } + @Test + public void sumOfRollTest(){ + //given + CrapsGame game = new CrapsGame(); + int num1=7; + int num2=11; + boolean expected = true; + //when + boolean actual =game.sumOfRoll(num1, num2); + + //then + Assert.assertEquals(expected, actual); + } + @Test + public void sumOfRollTest2(){ + //given + CrapsGame game = new CrapsGame(); + int num1=7; + int num2=6; + boolean expected = false; + //when + boolean actual =game.sumOfRoll(num1, num2); + + //then + Assert.assertEquals(expected, actual); + } + @Test + public void sumOfRollTest3(){ + //given + CrapsGame game = new CrapsGame(); + int num1=6; + int num2=7; + boolean expected = false; + //when + boolean actual =game.sumOfRoll(num1, num2); + + //then + Assert.assertEquals(expected, actual); + } + +} + + diff --git a/src/test/java/com/github/zipcodewilmington/casino/games/Craps/DiceTest.java b/src/test/java/com/github/zipcodewilmington/casino/games/Craps/DiceTest.java new file mode 100644 index 000000000..fd084e105 --- /dev/null +++ b/src/test/java/com/github/zipcodewilmington/casino/games/Craps/DiceTest.java @@ -0,0 +1,21 @@ +package com.github.zipcodewilmington.casino.games.Craps; + +import com.github.zipcodewilmington.casino.games.CrapsGame.Dice; +import org.junit.Assert; +import org.junit.Test; + +public class DiceTest { + + @Test + public void diceTest(){ + //given + Dice dice = new Dice(); + int expected=0; + //when + int actual = dice.rollingTheDice(); + + //then + Assert.assertNotEquals(expected, actual); + + } +} diff --git a/src/test/java/com/github/zipcodewilmington/casino/games/RandomNumberGeneratorTest.java b/src/test/java/com/github/zipcodewilmington/casino/games/RandomNumberGeneratorTest.java new file mode 100644 index 000000000..dbf53ae0e --- /dev/null +++ b/src/test/java/com/github/zipcodewilmington/casino/games/RandomNumberGeneratorTest.java @@ -0,0 +1,38 @@ +package com.github.zipcodewilmington.casino.games; + +import com.github.zipcodewilmington.casino.games.keno.KenoGame; +import org.junit.Assert; +import org.junit.Test; + +import java.util.Set; + +public class RandomNumberGeneratorTest { + + @Test + public void generateRandomNumbersTest() { + // Given + KenoGame kenoGame = new KenoGame(); + Integer expectedSizeOfSet = 20; + + // When + Set setOfNumbers = kenoGame.generateRandomNumbers(); + Integer actualSizeOfSet = setOfNumbers.size(); + + // Then + Assert.assertEquals(expectedSizeOfSet, actualSizeOfSet); + } + + @Test + public void generateRandomNumberTest() { + // Given + KenoGame kenoGame = new KenoGame(); + Integer minNumber = 1; + Integer maxNumber = 80; + + // When + Integer randomNumber = kenoGame.generateRandomNumber(); + + // Then + Assert.assertTrue(randomNumber >= minNumber && randomNumber <= maxNumber); + } +} diff --git a/src/test/java/com/github/zipcodewilmington/casino/games/Roulette/RouletteTest.java b/src/test/java/com/github/zipcodewilmington/casino/games/Roulette/RouletteTest.java new file mode 100644 index 000000000..dcb7d5e3b --- /dev/null +++ b/src/test/java/com/github/zipcodewilmington/casino/games/Roulette/RouletteTest.java @@ -0,0 +1,18 @@ +package com.github.zipcodewilmington.casino.games.Roulette; + +import com.github.zipcodewilmington.casino.games.roulette.RouletteGame; +import org.junit.Test; + +public class RouletteTest { + + @Test + public void choosingABetTest(){ + //given + RouletteGame game = new RouletteGame(); + int input=2; + String expect = ""; + //when + + //then + } +} diff --git a/src/test/java/com/github/zipcodewilmington/casino/games/keno/KenoGameTest.java b/src/test/java/com/github/zipcodewilmington/casino/games/keno/KenoGameTest.java new file mode 100644 index 000000000..d7ff12ae3 --- /dev/null +++ b/src/test/java/com/github/zipcodewilmington/casino/games/keno/KenoGameTest.java @@ -0,0 +1,112 @@ +package com.github.zipcodewilmington.casino.games.keno; + +import com.github.zipcodewilmington.casino.CasinoAccount; +import com.github.zipcodewilmington.casino.PlayerInterface; +import com.github.zipcodewilmington.casino.games.RandomNumberGenerator; +import org.junit.Assert; +import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; + +import java.util.HashSet; +import java.util.Set; + +public class KenoGameTest { + + @Test + public void addTest() { + // Given + CasinoAccount casinoAccount = new CasinoAccount("Zach", "Kitto", 22, 2000.0); + KenoGame kenoGame = new KenoGame(); + PlayerInterface expectedPlayer = new KenoPlayer(casinoAccount, kenoGame); + + // When + kenoGame.add(expectedPlayer); + PlayerInterface actualPlayer = kenoGame.getPlayer(casinoAccount.getUsername()); + + // Then + Assert.assertEquals(expectedPlayer, actualPlayer); + } + + @Test + public void removeTest() { + // Given + CasinoAccount casinoAccount1 = new CasinoAccount("Zach", "Kitto", 22, 2000.0); + CasinoAccount casinoAccount2 = new CasinoAccount("Mack", "Kitto", 22, 2000.0); + KenoGame kenoGame = new KenoGame(); + PlayerInterface player1 = new KenoPlayer(casinoAccount1, kenoGame); + PlayerInterface player2 = new KenoPlayer(casinoAccount2, kenoGame); + Integer expectedAmountOfPlayers = 1; + + // When + kenoGame.add(player1); + kenoGame.add(player2); + kenoGame.remove(player1); + Integer actualAmountOfPlayers = kenoGame.getPlayers().size(); + + // Then + Assert.assertEquals(expectedAmountOfPlayers, actualAmountOfPlayers); + } + + /*@Test + public void runTest() { + // Given + CasinoAccount casinoAccount1 = new CasinoAccount("Zach", "Kitto", 22, 2000.0); + CasinoAccount casinoAccount2 = new CasinoAccount("Mack", "Kitto", 22, 2000.0); + KenoGame kenoGame = new KenoGame(); + KenoPlayer player1 = new KenoPlayer(casinoAccount1, kenoGame); + KenoPlayer player2 = new KenoPlayer(casinoAccount2, kenoGame); + Integer expectedPlayer1SetOfNumbersSize = 10; + Integer expectedPlayer2SetOfNumbersSize = 10; + + // When + kenoGame.add(player1); + kenoGame.add(player2); + kenoGame.run(); + Integer actualPlayer1SetOfNumbersSize = player1.chosenNumbers.size(); + Integer actualPlayer2SetOfNumbersSize = player2.chosenNumbers.size(); + + // Then + Assert.assertEquals(expectedPlayer1SetOfNumbersSize, actualPlayer1SetOfNumbersSize); + Assert.assertEquals(expectedPlayer2SetOfNumbersSize, actualPlayer2SetOfNumbersSize); + }*/ + + @Test + public void getPlayerTest() { + // Given + CasinoAccount casinoAccount1 = new CasinoAccount("Zach", "Kitto", 22, 2000.0); + CasinoAccount casinoAccount2 = new CasinoAccount("Mack", "Kitto", 22, 2000.0); + KenoGame kenoGame = new KenoGame(); + KenoPlayer player1 = new KenoPlayer(casinoAccount1, kenoGame); + KenoPlayer player2 = new KenoPlayer(casinoAccount2, kenoGame); + KenoPlayer expectedPlayer = player1; + + // When + kenoGame.add(player1); + kenoGame.add(player2); + KenoPlayer actualPlayer = kenoGame.getPlayer("Zach"); + + + // Then + Assert.assertEquals(expectedPlayer, actualPlayer); + } + + @Test + public void getPlayersTest() { + // Given + CasinoAccount casinoAccount1 = new CasinoAccount("Zach", "Kitto", 22, 2000.0); + CasinoAccount casinoAccount2 = new CasinoAccount("Mack", "Kitto", 22, 2000.0); + KenoGame kenoGame = new KenoGame(); + KenoPlayer player1 = new KenoPlayer(casinoAccount1, kenoGame); + KenoPlayer player2 = new KenoPlayer(casinoAccount2, kenoGame); + Set expectedPlayers = new HashSet<>(); + expectedPlayers.add(player1); expectedPlayers.add(player2); + + // When + kenoGame.add(player1); + kenoGame.add(player2); + Set actualPlayers = kenoGame.getPlayers(); + + // Then + Assert.assertEquals(expectedPlayers, actualPlayers); + } +} diff --git a/src/test/java/com/github/zipcodewilmington/casino/games/keno/KenoPlayerTest.java b/src/test/java/com/github/zipcodewilmington/casino/games/keno/KenoPlayerTest.java new file mode 100644 index 000000000..f34053c4e --- /dev/null +++ b/src/test/java/com/github/zipcodewilmington/casino/games/keno/KenoPlayerTest.java @@ -0,0 +1,59 @@ +package com.github.zipcodewilmington.casino.games.keno; + +import com.github.zipcodewilmington.casino.CasinoAccount; +import org.junit.Assert; +import org.junit.Test; + +import java.util.HashSet; +import java.util.Set; + +public class KenoPlayerTest { + + @Test + public void constructorTest() { + // Given + CasinoAccount expectedCasinoAccount = new CasinoAccount("Zach", "Kitto", 22, 2000.0); + CasinoAccount casinoAccount2 = new CasinoAccount("Mack", "Kitto", 22, 2000.0); + KenoGame kenoGame = new KenoGame(); + KenoPlayer kenoPlayer = new KenoPlayer(expectedCasinoAccount, kenoGame); + + // When + CasinoAccount actualCasinoAccount = kenoPlayer.getArcadeAccount(); + + // Then + Assert.assertEquals(expectedCasinoAccount, actualCasinoAccount); + } + + @Test + public void checkHowManyMatchTest() { + // Given + CasinoAccount casinoAccount1 = new CasinoAccount("Zach", "Kitto", 22, 2000.0); + CasinoAccount casinoAccount2 = new CasinoAccount("Mack", "Kitto", 22, 2000.0); + KenoGame kenoGame = new KenoGame(); + KenoPlayer kenoPlayer = new KenoPlayer(casinoAccount1, kenoGame); + + // When + kenoPlayer.chosenNumbers = kenoGame.generateRandomNumbers(); + Integer numberOfMatches = kenoPlayer.checkHowManyMatch(); + + // Then + Assert.assertTrue(numberOfMatches >= 0 && numberOfMatches <= 10); + } + + @Test + public void outcomeOfGameTest() { + // Given + CasinoAccount casinoAccount1 = new CasinoAccount("Zach", "Kitto", 22, 2000.0); + CasinoAccount casinoAccount2 = new CasinoAccount("Mack", "Kitto", 22, 2000.0); + KenoGame kenoGame = new KenoGame(); + KenoPlayer kenoPlayer = new KenoPlayer(casinoAccount1, kenoGame); + + // When + kenoPlayer.chosenNumbers = kenoGame.generateRandomNumbers(); + kenoPlayer.checkHowManyMatch(); + Integer prizeMoney = kenoPlayer.outcomeOfGame(1); + + // Then + Assert.assertTrue(prizeMoney >= 2 && prizeMoney <= 10000); + } +}