Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ashley #25

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c989258
git test
r-m-hufford Mar 15, 2021
b33deed
UML Diagram
r-m-hufford Mar 15, 2021
f4f013c
oops
liamkbecker Mar 16, 2021
ddfd733
Filled out much of CrapsDisplay
liamkbecker Mar 16, 2021
013ae20
UML Diagram
r-m-hufford Mar 16, 2021
0c2e482
Beetle added. Beetle Display started
r-m-hufford Mar 16, 2021
6d39c09
BeetleDisplay progress. GoFishDisplay added
r-m-hufford Mar 16, 2021
94439b9
Checkpointing
liamkbecker Mar 16, 2021
0eb2398
Checkpointing
liamkbecker Mar 16, 2021
897bf97
Appeasing uncle bob
liamkbecker Mar 16, 2021
c1f42d1
Started writing Diplay class methods
theresa-christina Mar 16, 2021
04acff4
GoFishDisplay progress
r-m-hufford Mar 16, 2021
f109c06
game interface. dice game abstract class.
r-m-hufford Mar 16, 2021
9691781
Merge pull request #1 from smartist17/ryan
r-m-hufford Mar 16, 2021
5c4fdf5
goFishDisplay and dice abstract class
r-m-hufford Mar 16, 2021
e8c865c
Completed more methods for Display class
theresa-christina Mar 16, 2021
67e19f0
Added methods to CardGame class
theresa-christina Mar 16, 2021
48b31dc
Merge branch 'master' into theresa
smartist17 Mar 16, 2021
5bb287f
Merge pull request #3 from smartist17/ryan
smartist17 Mar 16, 2021
043f39f
Merge pull request #2 from smartist17/theresa
smartist17 Mar 16, 2021
b6fba0e
Merge pull request #4 from smartist17/HazelBranch
smartist17 Mar 16, 2021
36598ec
Wrote methods for PlayerWarehouse class
theresa-christina Mar 17, 2021
48dab13
drew a beetle. Player class.
r-m-hufford Mar 17, 2021
412574f
Merge pull request #5 from smartist17/ryan
r-m-hufford Mar 17, 2021
e1f79a0
Merge branch 'master' into theresa
theresa-christina Mar 17, 2021
17106ef
Merge pull request #6 from smartist17/theresa
theresa-christina Mar 17, 2021
15ce9b5
Interfaces + bj display
smartist17 Mar 17, 2021
55de8a3
Merge branch 'master' into Ashley
r-m-hufford Mar 17, 2021
2d9a633
Merge pull request #7 from smartist17/Ashley
r-m-hufford Mar 17, 2021
78ae165
Black jack display complete
smartist17 Mar 17, 2021
2317eb7
Merge pull request #8 from smartist17/HazelBranch
smartist17 Mar 17, 2021
b56b0ae
Black jack display complete
smartist17 Mar 17, 2021
e3f50ce
Blackjack display complete
smartist17 Mar 17, 2021
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
Binary file added .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ local.properties
.settings/
.loadpath
.recommenders
.DS_Store

# External tool builders
.externalToolBuilders/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* `Player` objects should be created upon input from a user.
* `Game` interface
* Contract which ensures that a class enforces some aspect of _playing_.
* `GamblingGame` interface
* `io.zipcoder.casino.GamblingGame` interface
* Contract which ensures that a game enforces some aspect of _waging money_.
* `GamblingPlayer` interface
* Contract which ensures that a player has some ability to _wage money_.
Expand Down
Binary file added src/Casino Structure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
199 changes: 199 additions & 0 deletions src/Casino Structure.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
@startuml
'https://plantuml.com/class-diagram

Game <|-- GamblingGame
Game <|-- CardGame
GamblingPlayer <|-- Player
GamblingGame <|-- Blackjack
GamblingGame <|-- DiceGame

DiceGame <|-- Beetle
DiceGame <|-- Craps
CardGame <|-- Blackjack
CardGame <|-- GoFish


Display <|-- BeetleDisplay
Display <|-- CrapsDisplay
Display <|-- BlackjackDisplay
Display <|-- GoFishDisplay


'INTERFACE
interface Game {
Random
Boolean gameState
checkForWinner()
setPlayer()
}

interface GamblingGame {
acceptBetFrom()
calculateReward()
calculateLoss()
}

interface GamblingPlayer {
placeBet()
}


'ABSTRACT CLASS
abstract class CardGame{
Stack decksOfCards
ArrayList playersHand
ArrayList dealersHand
shuffleCards()
dealCards(Int numberOfCards)
skipDeal()

}

abstract class DiceGame {
rollDice(numberOfDice)
}


'CLASS
class Main{

}

class CasinoEngine {
runCasino()
}

class Player {
String name
Double accountBalance
getName()
getAccountBalance()
setAccountBalance()
}

class GoFish {
HashMap <Player, Hand>
HashMap <Player, NumberOfPairs>
exchangeCard()
getNumberOfPairs()
setNumberOfPairs()
}

class GoFishDisplay {
chooseAPlayerToAsk()
chooseACardtoAskFor()
playerHasCard()
goFish()
pairMade()

}

class Blackjack {
HashMap <String cardFaceValue, Int CardPointValue>
gotBlackJack(int betPlaced)
standOrHit()
}

class BlackjackDisplay {
dealersFirstCard()
bustMessage(String whoBusted)
dealersTotal()
dealerStands()
dealerHits()
chooseStandOrHit()
}

class Craps {
Boolean isNatural()
Boolean isCraps()
Boolean isPoint()
analyzeComeOutRoll()
analyzeFollowingRolls()
'comeBet()
'dontComeBet()
'passBet()
'dontPassBet()
'fieldBet()
'bigSixOrEightBet()
getTypeOfBet()
}

class CrapsDisplay {
rulesMenu()
optionsMenu()
shooterScores()
shooterSevenedOut()
push()
oneRollBetLoss()
onRollBetWin()
natural()
craps()
shooterRolled()
setTypeOfBet()
comeOutRoll()

}

class Beetle {
createNextImage()
}

class BeetleDisplay {
drawBugHead()
drawBugBody()
drawBugLeg1()
drawBugLeg2()
drawBugLeg3()
drawBugLeg4()
playerBugComplete()
opponentBugComplete()
repeatRoll()
bodyPartValue()
}

class PlayerWarehouse {
playerGroup <password, Player>
getPlayer()
}

class Console {
Scanner input
PrintStream output
print()
println()
getStringInput()
getDoubleInput()
getLongInput()
getIntegerInput()
}

class Display {
String currentDisplay

errorMessage()

'casino messages
welcomeMessage()
gamesMenu()
lowFundsWarning()
zeroFundsWarning()

'game messages
rollResult()
dealResult()
youWin()
youLose()
doYouWantToBet()

'new user messages
userId()
requestUserId()
initialDeposit()

'returning user messages
welcomeBack()

}


@enduml
4 changes: 4 additions & 0 deletions src/main/java/io/zipcoder/casino/Beetle.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package io.zipcoder.casino;

public class Beetle {
}
71 changes: 71 additions & 0 deletions src/main/java/io/zipcoder/casino/BeetleDisplay.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
package io.zipcoder.casino;

import io.zipcoder.casino.utilities.Console;

import java.util.Arrays;

public class BeetleDisplay extends Display {

String[][] beetle = new String[][]{{"\\","0","/"},
{"⎛","|","⎞"},
{"⎝","|","⎠"},
{"/","⏝","\\"}
};

public BeetleDisplay() {
}

public void rules() {
setPrintCurrentDisplay("Draw the beetle before your opponent and win big!\nThe rules are simple:\nEach side of the die corresponds to a part of the beetle." +
"\nIf you roll a number, you get to draw that part.\nIf you roll the same number again, you do not get to add to your beetle." +
"\nBetween each roll you will add to your wager.\nThe first person to draw a beetle keeps the purse." +
"\nIf both players complete their beetle on the same set of rolls the wagers are returned." +
"\n\nWhat to draw for each roll:" +
"\n1 - head\n2 - body\n3 - left front leg\n4 - right front leg\n5 - left back leg\n6 - right back leg");
}

public void drewLeg() {
setPrintCurrentDisplay("You added a leg to your beetle!");
}

public void drewBody() {
setPrintCurrentDisplay("You drew your beetle's body!");
}

public void drewHead() {
setPrintCurrentDisplay("You drew your beetle's head!");
}

public void yourBugIsComplete() {
setPrintCurrentDisplay("Your beetle is complete!");
}

public void opponentsBugisComplete() {
setPrintCurrentDisplay("Your opponents beetle is complete.");
}

public void bothBeetlesComplete() {
setPrintCurrentDisplay("You both drew beetles. The game is a tie.");
}

public void repeatedRollResult() {
setPrintCurrentDisplay("You already rolled that number.");
}

//Beetle Body Parts
public void getBeetleComplete() {
//System.out.println(Arrays.deepToString(beetle));
/*for (String[] row : beetle) {
System.out.println(Arrays.deepToString(row));*/
for (int i = 0; i < beetle.length; i++) {
for (int j = 0; j < beetle[i].length; j++) {
System.out.print(beetle[i][j] + " ");
}
System.out.println();
}
}

public void getCurrentBeetle() {

}
}
100 changes: 100 additions & 0 deletions src/main/java/io/zipcoder/casino/BlackJackDisplay.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
package io.zipcoder.casino;

public class BlackJackDisplay extends Display {

public void rules() {
setPrintCurrentDisplay("Your goal is to draw cards that total 21, or come closer to 21 than the dealer without going over"+

"\nMake a bet from $1 to all-in, receive your cards" +

"\nThe dealer will give you two blackjack cards and show one of his cards, decide if you want to double your bet" +

"\nYou can double your bet any time before you hit OR stand and split your bet if you get two cards of the same value." +

"\nConsider if you want to ‘hit’" +

"\nYou have an option to add more blackjack cards by choosing 'hit', but you lose automatically if your value of cards exceeds 21." +

"\nChoose 'stand' when you are ready to play your hand. learn the dealer’s hand" +

"\nThe dealer will reveal his hidden blackjack card and must always hit if they have 16 or lower. They will stop hitting if they have 17 or more." +

"\nYou win when the combined value of your cards is greater than that of the dealer."+

"\nYou lose if you have a lower score than the dealer, or if the total of your cards exceeds 21.");

//TIPS
/*"\nThe dealer and each player start with two cards. The dealer’s first card faces up, the second faces down."+

"\nFace cards each count as 10, Aces count as 1 or 11, all others count at face value."+

"\nAn Ace with any 10, Jack, Queen, or King is a “Blackjack.”:");*/
}

public void dealtHand(){

setPrintCurrentDisplay("You were dealt ");
}

public void hitOrStand(){

setCurrentDisplay("Do you want to hit or stand?");
}

public void dealerHit() {

setPrintCurrentDisplay("Your hand total is ");
}

public void playerHit(){

setPrintCurrentDisplay("You hit 21!");

}

public void dealerStand() {

setPrintCurrentDisplay("Do you want to hit or stand?");

}

public void bust(){

setPrintCurrentDisplay("You passed 21! Bust...");
}

public void dealerBust(){

setPrintCurrentDisplay("The dealer busted.");
}

public void wonGame(){

setPrintCurrentDisplay("You win");

}

public void lostGame(){

setPrintCurrentDisplay("You lost");
}

public void blackJack(){

setPrintCurrentDisplay("You got Black Jack!");

}

public void splitPairs() {

setPrintCurrentDisplay("Would you like to split pairs?");

}

public void doubleDown() {

setPrintCurrentDisplay("");

}

}
Loading