Skip to content

GabiAndrea UML Created for Review #1

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

Open
wants to merge 56 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
1e75665
Added Untitled Diagram.xml
Gabba42 Nov 19, 2017
4115a36
Update Untitled Diagram.xml
Gabba42 Nov 19, 2017
c1cf9b5
Update Untitled Diagram.xml
Gabba42 Nov 19, 2017
82555ed
Added GabAndreaCasinoUML.xml
asusnick Nov 19, 2017
0c85804
Added GabAndreaCasinoUML.pdf
asusnick Nov 19, 2017
6fbeaac
Merge pull request #1 from asusnick/master
Gabba42 Nov 19, 2017
c528f21
Delete Untitled Diagram.xml
Gabba42 Nov 19, 2017
fc5f2c1
Add files via upload
asusnick Nov 20, 2017
bfe99eb
Merge pull request #2 from asusnick/master
Gabba42 Nov 20, 2017
ae169fb
Added GabAndreaRyanCasinoUML updated.xml
asusnick Nov 20, 2017
d1bd585
Added GabAndreaRyanCasinoUML updated.pdf
asusnick Nov 20, 2017
f25cef9
Merge pull request #3 from asusnick/master
Gabba42 Nov 20, 2017
aef884c
Delete GabAndreaCasinoUML.xml
Gabba42 Nov 20, 2017
f82cfd0
Delete GabAndreaCasinoUML.pdf
Gabba42 Nov 20, 2017
0d1ffaa
Added GabAndreaRyanCasinoUML updated 11.20.17
asusnick Nov 21, 2017
6f277f4
Added GabAndreaRyanCasinoUML updated 11.20.17.pdf
asusnick Nov 21, 2017
8c1d014
Creation of some classes/ No implmentation yet.
Nov 21, 2017
0d4f312
Merge pull request #4 from asusnick/master
Gabba42 Nov 21, 2017
6a1f925
Delete GabAndreaRyanCasinoUML updated.pdf
Gabba42 Nov 21, 2017
8b6ca95
Delete GabAndreaRyanCasinoUML updated.xml
Gabba42 Nov 21, 2017
22afe9d
Merge branch 'master' of https://github.com/Gabba42/CR-Casino
Nov 21, 2017
0614007
Merge pull request #1 from Gabba42/master
maiale21 Nov 21, 2017
de8910a
Merge pull request #1 from Gabba42/master
asusnick Nov 21, 2017
5221369
Updated Casino App, added classes and rearranged methods
Nov 21, 2017
1d091da
Merge pull request #2 from Gabba42/master
asusnick Nov 21, 2017
c93d8fa
console input
Nov 22, 2017
16f9667
Merge pull request #5 from maiale21/master
maiale21 Nov 22, 2017
00a27b3
updated craps logic
Nov 26, 2017
6f6d003
adding Ryan's console input class
Nov 26, 2017
3b46b8c
Merge branch 'master' of https://github.com/Gabba42/CR-Casino
Nov 26, 2017
5693984
created craps test
Nov 26, 2017
1ce3a5c
Merge pull request #6 from asusnick/master
Gabba42 Nov 26, 2017
63232c9
updated Crabs class and implemented DicePlayer
Nov 26, 2017
46b509e
commiting CrapsTest
Nov 26, 2017
d10bb5c
nothing changes, ignore tthem
Nov 26, 2017
cdad76c
Merge pull request #7 from maiale21/master
Gabba42 Nov 26, 2017
03f7d0a
fingers crossed
Nov 26, 2017
42ff57c
craps game rolls
Nov 26, 2017
e109001
odified craps test
Nov 26, 2017
8e580d6
Merge pull request #8 from asusnick/master
Gabba42 Nov 26, 2017
f356af0
Merge branch 'master' into master
Gabba42 Nov 26, 2017
7535994
Merge branch 'master' into master
Gabba42 Nov 26, 2017
b61be9c
Merge pull request #9 from maiale21/master
Gabba42 Nov 26, 2017
294fe35
updated a few classes and tests
Nov 26, 2017
cb2d334
Merge pull request #10 from asusnick/master
Gabba42 Nov 26, 2017
5b74d1e
did something in craps class...
Nov 26, 2017
353856a
taking in andrea's changes
Nov 26, 2017
8dcc3cb
bullshit
Nov 26, 2017
ba4aa02
craps game logic
Nov 27, 2017
d5cb555
Merge pull request #11 from maiale21/master
Gabba42 Nov 27, 2017
838d213
working console input and casino menu
Nov 27, 2017
f927557
Merge pull request #12 from asusnick/master
Gabba42 Nov 27, 2017
3b30d15
Craps game logic works, now clean it up
Nov 27, 2017
2d624c4
Merge pull request #13 from maiale21/master
Gabba42 Nov 27, 2017
f51ba4d
committing changes
Nov 27, 2017
ae17c56
user can now press enter to roll the dice.
Dec 6, 2017
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
41 changes: 41 additions & 0 deletions Casino User Stories.rtf
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{\rtf1\ansi\ansicpg1252\cocoartf1561
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
\margl1440\margr1440\vieww38200\viewh18720\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0

\f0\fs24 \cf0 As a <Player>, I want to\'85\
1. open the Casino App, so that I can play a variety of games.\
2. see a menu of game options, so that I can choose which game I want to play.\
3. choose the BlackJack game, so that I can play BlackJack.\
4. be able to make a bet, so that I can gamble.\
5. be able to see my current hand and the dealer\'92s hand, so that I can decide to hit or stay.\
6. have the Ace to automatically be a 1 or 11 based on my hand.\
7. have the game continue until I either bust or stay.\
8. know if I have won once the round is over, so that I can collect my winnings and increase my wallet.\
9. know if I have lost once the round is over, so that it will decrease my wallet based on how much I have bet.\
10. be asked if I want to stay for another round, so that if I say yes I can continue playing or if I say no I can go back to the main menu and choose another game to play.\
11. choose the GoFish game, so that I can play GoFish.\
12. be dealt 7 cards, so that I have a full hand and be able to view my cards.\
13. have my hand sorted and if I already have a four of a kind, I want my score and hand to be updated.\
14. be able to ask for a card (i.e. Do you have any 2s?), so that I can possibly be given that card.\
15. be told to \'93Go Fish\'94 and pull a card from the pile, if I am not given the card I want.\
16. if that card that I pull from the pile is the card that I need (or not need), I want my hand to be updated with that card.\
17. be able to go again, if the card is the card I want.\
18. if the card is not the card I want, then it becomes the computer\'92s turn. \
19. be asked for a specific card from the computer and if I have that card the program automatically takes it from my hand and continues to ask for a card until I don\'92t have the card in my hand.\
20. if I do not have the card in my hand, be given a prompt that let\'92s me know the computer has to \'93Go Fish\'94. \
21. continue playing until the pile runs out or if one of the hands runs out.\
22. be given a prompt that the game ends, if the pile runs out or if one of the hands runs out.\
23. if the game ends, I want the computer\'92s score(all of its four of a kinds) and my score(all of my four of a kinds) to be calculated and then the winner be determined based on who has the highest score.\
24. be asked if I want to stay for another round, so that if I say yes I can continue playing or if I say no I can go back to the main menu and choose another game to play.\
25. choose the Craps game, so that I can play Craps.\
26. be able to make a bet, so that I can gamble.\
27. be given a prompt that I have rolled diced and then be given the value of the combined dice.\
28. on my first roll, if I roll a 7 or 11, I expect to win my bet and be asked if I want to bet again(to continue playing) or end the game.\
29. on my first roll, if I roll a 2, 3, 12, I expect to lose my bet and be asked if I want to bet again(to continue playing) or end the game.\
30. on my first roll, if I roll any other value, I expect to receive a prompt that the value is now my point and I need to roll again.\
31. be continually asked to roll the dice until I have rolled my point in which I will win or if I rolled a 7 in which I will lose.\
32. I will then be prompted if I want to play again or go back to the main menu to choose another game.\
33. At the main menu, I expect to be able to exit the Casino Application safely. }
1 change: 1 addition & 0 deletions GabAndreaRyanCasinoUML updated 11.20.17
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36" version="7.7.2" editor="www.draw.io" type="github"><diagram id="ad9d87c2-1466-4a9b-f68f-80986c760cac" name="Page-1">7Z1tb9s2EIB/jYH0Qwe92LL90S9N2i3ZgrrYPg6MTFtEZFGg6CTurx8pUbIdUpkaUUrQ3lAgEk2/iM/d8e545Ab+Yvd0xVAa3dA1jgees34a+MuB57nBxBV/ZMuhaBlPnKJhy8hadTo2rMh3rBrLbnuyxtlZR05pzEl63hjSJMEhP2tDjNHH824bGp9/a4q2WGtYhSjWW/8hax4VrZORc2z/jMk2Kr/ZddQrdy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Za5Dc7Bm4Y6BbbfAyclcSyY4qpoBj55cNOmkN+g00/rmOKecBFfgW2Hrf9uI7uJOcrPDTNt9tCxsoW1D53+7hOnUtMMjnLGo9UB7ot6PZ5Gpzr1O2YzaL9ZhOD0lrD2utBcK6jhzwLJpxFcIp726B3Xm1h+t/JdekU6yu5xVycC/fpEY+g1EelnjSm/BZeseHQc/CKX4WtT6/YcEy5mmFlSlE8n5piQQ1fz7NXh9itO4VxC0BtAe3VB3br0sNM+BJ4fcoUIhwbdPt1hQ1nzy/Juyqe+Kkd4efZ4cBvaKxtHAjlGg6xz2tUiayvccATrtHpSmfeqScMJRSWsPXqCddlEuU8uxQaWUyyais8qKUNvh16xuKWUVmDVr12xVAa3dA1lj3+Aw==</diagram></mxfile>
Binary file added GabAndreaRyanCasinoUML updated 11.20.17.pdf
Binary file not shown.
44 changes: 44 additions & 0 deletions src/main/java/io/zipcoder/casino/BlackJack.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//package io.zipcoder.casino;
//
//public class BlackJack extends CardGame implements Game {
//
// //dealer and player object? where would they live
//
// private Player player = new BlackJackPlayer();
//
// private Player dealer = new BlackJackDealer();
//
// public BlackJack() { }
//
// public boolean reportWinner() {
// // if both player and dealer scores are = to 21 dealer wins
// // if both player and dealer score are over 21 then dealer wins
// // if player's score is <= 21 and players score is greater than dealers score then player wins.
// //if dealer's score is > 21 and player's score is <= 21 then players wins.
// player.calculateScore();
// dealer.calculateScore();
//
// if( (player.getScore().equals(21) && !dealer.getScore().equals(21)) ||
// (player.getScore()<21 && dealer.getScore() < player.getScore()) ||
// (player.getScore() < 21 && dealer.getScore() > 21)) {
// //Player wins
// return true;
// }
// //Dealer wins
// return false;
// }
//
// public void play() {
// //Deal two cards to the player and the dealer
// for (int i = 0; i < 2; i++)
// {
// dealCard(player);
// dealCard(dealer);
// }
//
// } //start the playing field specific for BlackJack
//
// public void placeBet(Double money) {
//
// }
//}
4 changes: 4 additions & 0 deletions src/main/java/io/zipcoder/casino/BlackJackConsole.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package io.zipcoder.casino;

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

public class BlackJackDealer {




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

//public class BlackJackPlayer extends CardGamePlayer implements Gamble {
//
// public void placeBet(Double money) {
//
// }
//
// public boolean hasMoneyToMakeBet(Double amount) {
// return (amount <= super.getMoney());
// }
//
//
// public void cashInWinnings(Double winnings) {
// money += winnings;
// }
//}
39 changes: 39 additions & 0 deletions src/main/java/io/zipcoder/casino/Card.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package io.zipcoder.casino;

public class Card {
private Suit suit;
public static String[] suitSymbols = {"♡", "♢", "♧", "♤"};
public static String[] faceSymbols = {"A", "J", "Q", "K"};
private Integer value;
private String cardRepresentation;

private Card() { }

public Card(Suit suit, Integer value) {
this.suit = suit;
this.value = value;
}

public Card(Suit passedSuit, Integer passedValue, String passedSuitRepresentation, String passedFaceRepresentation) {
suit = passedSuit;
value = passedValue;
cardRepresentation = String.format("%s%-4s", passedFaceRepresentation, passedSuitRepresentation);
}

@Override
public String toString() {
return cardRepresentation;
}

public String getCardRepresentation() {
return cardRepresentation;
}

public Integer getValue() {
return value;
}

public Suit getSuit() {
return suit;
}
}
28 changes: 28 additions & 0 deletions src/main/java/io/zipcoder/casino/CardGame.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package io.zipcoder.casino;

import java.util.ArrayList;

public abstract class CardGame extends Deck {

ArrayList<Card> hand = new ArrayList<Card>();

public ArrayList<Card> showHand() {
return hand;
}

public boolean isHandEmpty() {
if(hand.size() == 0) {
return true;
}
return false;
}

public void addToHandFromPile() {
//taking top card from the pile (cards in Deck)
hand.add(getCard());
}

public void addToHandFromPlayer() {

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

import java.util.ArrayList;

public class CardGamePlayer extends Player {

ArrayList<Card> hand = new ArrayList<Card>();

// public void addToHandFromPile() {
// //taking top card from the pile (cards in Deck)
// hand.add(getCard());
// }

public void addToHandFromPlayer() {

}
}

21 changes: 21 additions & 0 deletions src/main/java/io/zipcoder/casino/Casino.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,25 @@


public class Casino {

public static Casino casino = new Casino();

public static void main(String[] args) {
Craps craps;

System.out.println("\t\t~~ Welcome to the Crap's Casino ~~\n" +
"Where the only game to play is craps and you better like it!");

do {
String userInput = ConsoleInput.getStringInput("Which of our many fabulous games would like to play?\n" +
"[ CRAPS ]\t[ BLACKJACK ]\t[ GOFISH ]\t[ ROULETTE ]");
if ("CRAPS".equalsIgnoreCase(userInput) || "CRABS".equalsIgnoreCase(userInput)) {
craps = new Craps();
craps.play();
} else {
System.out.println("\nPyshc, we don't have " + userInput + "! What kind of place do you think this is?!\n");
}
} while (true);
}
}

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

import java.util.Scanner;

public class ConsoleInput {

public static String getStringInput(String prompt) {
do {
System.out.println(prompt);
Scanner scanner = new Scanner(System.in);
String userInput = scanner.nextLine();
try {
if (userInput.isEmpty())
throw new IllegalArgumentException();
return userInput;
} catch (IllegalArgumentException iae) {
System.out.println("Invalid input, please enter a valid response.");
}

} while (true);
}

//cannot get to work...
// public static void rollDicePrompt() {
// Scanner scanner = new Scanner(System.in);
// System.out.println("Please press the enter key to roll the dice!");
// String readString = scanner.nextLine();
// if (readString.isEmpty()) {
// Die die = new Die();
// die.rollDice();
// }
// }

public static Double getDoubleInput(String prompt){
String userInput;

do{
userInput = getStringInput(prompt);
try{
return Double.parseDouble(userInput);
}catch (IllegalArgumentException iae){
System.out.println("Invalid input, please enter a valid response.");
}
}while (true);
}

public static Integer getIntegerInput(String prompt){
return getDoubleInput(prompt).intValue();
}
}
Loading