diff --git a/.idea/TypeScript-Casino.iml b/.idea/TypeScript-Casino.iml
new file mode 100644
index 00000000..d6ebd480
--- /dev/null
+++ b/.idea/TypeScript-Casino.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 00000000..3ef56a28
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 00000000..7b159a56
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/typescript-compiler.xml b/.idea/typescript-compiler.xml
new file mode 100644
index 00000000..76f3e5fe
--- /dev/null
+++ b/.idea/typescript-compiler.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 00000000..35eb1ddf
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 00000000..cdf26179
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,947 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ DEFINITION_ORDER
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TypeScript
+
+
+
+
+ TypeScriptCheckImport
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1521829804384
+
+
+ 1521829804384
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1.8
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/README.md b/README.md
index 26570c51..94aaf9cb 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@
### `Profile` class
* **Description:**
- * `Profile` stores a casino-visitor's `id`, `name`, and `balance`.
+* `Profile` stores a casino-visitor's `id`, `name`, and `balance`.
* `Profile` objects should be created within the context of a casino.
* `Profile` objects store `profileId`, `username`, and `balance`.
diff --git a/classes/App.js b/classes/App.js
new file mode 100644
index 00000000..e5cba5d1
--- /dev/null
+++ b/classes/App.js
@@ -0,0 +1,14 @@
+"use strict";
+exports.__esModule = true;
+///
+var BlackJack_1 = require("./blackjack/BlackJack");
+var App = /** @class */ (function () {
+ function App() {
+ }
+ App.main = function () {
+ var blackjack;
+ blackjack = new BlackJack_1.BlackJack('player', 'dealer');
+ blackjack.start();
+ };
+ return App;
+}());
diff --git a/classes/App.ts b/classes/App.ts
new file mode 100644
index 00000000..bfd11f3d
--- /dev/null
+++ b/classes/App.ts
@@ -0,0 +1,13 @@
+///
+import {BlackJack} from "./blackjack/BlackJack";
+import {CasinoPlayer} from "./CasinoPlayer";
+
+class App {
+
+ public static main(): void {
+ var blackjack: BlackJack;
+ blackjack = new BlackJack('player', 'dealer')
+ blackjack.start();
+
+ }
+}
diff --git a/classes/CardGame/CardGame.js b/classes/CardGame/CardGame.js
new file mode 100644
index 00000000..7ba1bb3b
--- /dev/null
+++ b/classes/CardGame/CardGame.js
@@ -0,0 +1,32 @@
+"use strict";
+///
+///
+exports.__esModule = true;
+var Deck_1 = require("../CardUtils/Deck");
+var CardGame = /** @class */ (function () {
+ function CardGame() {
+ this.deck = new Deck_1.Deck().getDeck();
+ }
+ CardGame.prototype.dealCards = function (dealer, player, amount) {
+ //clear hands
+ dealer.clearHand();
+ player.clearHand();
+ for (var i = 0; i < amount; i++) {
+ dealer.addCard(this.deck.pop());
+ player.addCard(this.deck.pop());
+ }
+ };
+ CardGame.prototype.dealCard = function (player, amount) {
+ for (var i = 0; i < amount; i++) {
+ player.addCard(this.deck.pop());
+ }
+ };
+ CardGame.prototype.createNewDeck = function () {
+ this.deck = new Deck_1.Deck().getDeck();
+ };
+ CardGame.prototype.getDeck = function () {
+ return this.deck;
+ };
+ return CardGame;
+}());
+exports.CardGame = CardGame;
diff --git a/classes/CardGame/CardGame.ts b/classes/CardGame/CardGame.ts
new file mode 100644
index 00000000..49012c11
--- /dev/null
+++ b/classes/CardGame/CardGame.ts
@@ -0,0 +1,40 @@
+///
+///
+
+import {Card} from "../CardUtils/Card";
+import {Deck} from "../CardUtils/Deck";
+import {CardGamePlayer} from "./CardGamePlayer";
+
+export class CardGame {
+
+ deck : Card[];
+
+ constructor(){
+ this.deck = new Deck().getDeck();
+ }
+
+ dealCards(dealer: CardGamePlayer, player: CardGamePlayer, amount: number){
+ //clear hands
+ dealer.clearHand();
+ player.clearHand();
+
+ for (let i = 0; i < amount; i++) {
+ dealer.addCard(this.deck.pop());
+ player.addCard(this.deck.pop());
+ }
+ }
+
+ dealCard (player: CardGamePlayer, amount: number){
+ for (let i = 0; i < amount; i++) {
+ player.addCard(this.deck.pop());
+ }
+ }
+
+ createNewDeck():void{
+ this.deck = new Deck().getDeck();
+ }
+
+ getDeck():Card[]{
+ return this.deck;
+ }
+}
\ No newline at end of file
diff --git a/classes/CardGame/CardGamePlayer.js b/classes/CardGame/CardGamePlayer.js
new file mode 100644
index 00000000..de5d1c37
--- /dev/null
+++ b/classes/CardGame/CardGamePlayer.js
@@ -0,0 +1,52 @@
+"use strict";
+var __extends = (this && this.__extends) || (function () {
+ var extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+ return function (d, b) {
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ };
+})();
+exports.__esModule = true;
+var CasinoPlayer_1 = require("../CasinoPlayer");
+var CardGamePlayer = /** @class */ (function (_super) {
+ __extends(CardGamePlayer, _super);
+ function CardGamePlayer() {
+ var _this = _super.call(this, "Card Player", 1000) || this;
+ _this.hand = [];
+ return _this;
+ }
+ CardGamePlayer.prototype.getHand = function () {
+ return this.hand;
+ };
+ CardGamePlayer.prototype.addCard = function (card) {
+ this.hand.push(card);
+ };
+ CardGamePlayer.prototype.clearHand = function () {
+ this.hand = [];
+ };
+ CardGamePlayer.prototype.setHand = function (hand) {
+ this.hand = hand;
+ };
+ CardGamePlayer.prototype.sort = function () {
+ this.hand.sort();
+ };
+ CardGamePlayer.prototype.displayHand = function (sort) {
+ if (sort) {
+ this.sort();
+ }
+ var displayHand = document.getElementById("playerHand");
+ displayHand.innerHTML = "";
+ for (var i = 0; i < this.hand.length; i++) {
+ var currentCard = this.hand[i];
+ displayHand.innerHTML += this.cardImg(currentCard);
+ }
+ };
+ CardGamePlayer.prototype.cardImg = function (card) {
+ return card.getFace() + "_of_" + card.getSuit();
+ };
+ return CardGamePlayer;
+}(CasinoPlayer_1.CasinoPlayer));
+exports.CardGamePlayer = CardGamePlayer;
diff --git a/classes/CardGame/CardGamePlayer.ts b/classes/CardGame/CardGamePlayer.ts
new file mode 100644
index 00000000..bfc0e981
--- /dev/null
+++ b/classes/CardGame/CardGamePlayer.ts
@@ -0,0 +1,48 @@
+import {Card} from "../CardUtils/Card";
+import {CasinoPlayer} from "../CasinoPlayer";
+
+export class CardGamePlayer extends CasinoPlayer{
+
+ hand: Card[];
+
+ constructor(){
+ super("Card Player", 1000);
+ this.hand = [];
+ }
+
+ getHand():Card[]{
+ return this.hand;
+ }
+ addCard(card:Card):void{
+ this.hand.push(card);
+ }
+
+ clearHand(){
+ this.hand = [];
+ }
+
+ setHand(hand:Card[]):void{
+ this.hand = hand;
+ }
+
+ sort():void{
+ this.hand.sort();
+ }
+
+ displayHand(sort:boolean):void{
+ if(sort){
+ this.sort()
+ }
+ let displayHand = document.getElementById("playerHand");
+ displayHand.innerHTML = "";
+ for (let i = 0; i < this.hand.length; i++) {
+ let currentCard: Card = this.hand[i]
+ displayHand.innerHTML += this.cardImg(currentCard);
+ }
+ }
+
+ cardImg(card:Card):string{
+ return card.getFace()+ "_of_" +card.getSuit();
+ }
+
+}
\ No newline at end of file
diff --git a/classes/CardUtils/Card.js b/classes/CardUtils/Card.js
new file mode 100644
index 00000000..db06e9ff
--- /dev/null
+++ b/classes/CardUtils/Card.js
@@ -0,0 +1,26 @@
+"use strict";
+exports.__esModule = true;
+var Card = /** @class */ (function () {
+ function Card(suit, rank, faceValue, location) {
+ this.suit = suit;
+ this.rank = rank;
+ this.face = faceValue;
+ this.location = location;
+ }
+ //generating the get methods made a GET keyword and then the name of the
+ //variable...I had to manually combine them.
+ Card.prototype.getSuit = function () {
+ return this.suit;
+ };
+ Card.prototype.getRank = function () {
+ return this.rank;
+ };
+ Card.prototype.getFace = function () {
+ return this.face;
+ };
+ Card.prototype.toString = function () {
+ return this.face + " of " + this.suit;
+ };
+ return Card;
+}());
+exports.Card = Card;
diff --git a/classes/CardUtils/Card.ts b/classes/CardUtils/Card.ts
new file mode 100644
index 00000000..fcb5051e
--- /dev/null
+++ b/classes/CardUtils/Card.ts
@@ -0,0 +1,37 @@
+export class Card {
+
+ private suit: string;
+ private rank: number;
+ private face: string;
+ private location: string;
+
+
+ constructor(suit: string, rank: number, faceValue: string, location: string) {
+ this.suit = suit;
+ this.rank = rank;
+ this.face = faceValue;
+ this.location = location;
+ }
+
+ //generating the get methods made a GET keyword and then the name of the
+ //variable...I had to manually combine them.
+
+ getSuit(): string {
+ return this.suit;
+ }
+
+ getRank(): number {
+ return this.rank;
+ }
+
+ getFace(): string {
+ return this.face;
+ }
+
+ toString(): string {
+ return this.face + " of " + this.suit;
+ }
+}
+
+
+
diff --git a/classes/CardUtils/Deck.js b/classes/CardUtils/Deck.js
new file mode 100644
index 00000000..8ea5e10d
--- /dev/null
+++ b/classes/CardUtils/Deck.js
@@ -0,0 +1,45 @@
+"use strict";
+///
+exports.__esModule = true;
+var Card_1 = require("./Card");
+var Deck = /** @class */ (function () {
+ function Deck() {
+ this.deck = [];
+ this.suits = ["clubs", "spades", "hearts", "diamonds"];
+ this.faces = ["ace", "2", "3", "4", "5", "6", "7", "8", "9", "10", "jack", "queen", "king"];
+ }
+ Deck.prototype.newDeck = function () {
+ //for every suit inside this.suits
+ for (var _i = 0, _a = this.suits; _i < _a.length; _i++) {
+ var suit = _a[_i];
+ for (var i = 0; i < this.faces.length; i++) {
+ //no zero value cards
+ var num = i + 1;
+ if (num > 10) {
+ //all faces are 10
+ num = 10;
+ }
+ this.deck.push(new Card_1.Card(suit, num, this.faces[i]));
+ }
+ }
+ this.shuffle();
+ };
+ Deck.prototype.getDeck = function () {
+ this.newDeck();
+ return this.deck;
+ };
+ Deck.prototype.shuffle = function () {
+ for (var i = 0; i < this.deck.length; i++) {
+ var ranNum = Math.floor(Math.random() * this.deck.length);
+ _a = [this.deck[ranNum], this.deck[i]], this.deck[i] = _a[0], this.deck[ranNum] = _a[1];
+ }
+ var _a;
+ };
+ return Deck;
+}());
+exports.Deck = Deck;
+// checking if file works
+var deck;
+deck = new Deck();
+deck.newDeck();
+console.log(deck);
diff --git a/classes/CardUtils/Deck.ts b/classes/CardUtils/Deck.ts
new file mode 100644
index 00000000..2e732e38
--- /dev/null
+++ b/classes/CardUtils/Deck.ts
@@ -0,0 +1,50 @@
+///
+
+import {Card} from "./Card";
+
+export class Deck {
+
+ private deck: Card[];
+ private suits: string[];
+ private faces: string[];
+
+ constructor() {
+ this.deck = [];
+ this.suits = ["clubs","spades","hearts","diamonds"];
+ this.faces = ["ace","2","3","4","5","6","7","8","9","10","jack","queen","king"]
+ }
+
+ newDeck(): void {
+ //for every suit inside this.suits
+ for (let suit of this.suits) {
+ for (let i = 0; i < this.faces.length; i++) {
+ //no zero value cards
+ let num = i + 1;
+ if (num > 10){
+ //all faces are 10
+ num = 10
+ }
+ this.deck.push(new Card(suit, num, this.faces[i]))
+ }
+ }
+ this.shuffle();
+ }
+
+ getDeck():Card[]{
+ this.newDeck();
+ return this.deck;
+ }
+
+ shuffle():void{
+ for (let i = 0; i < this.deck.length; i++) {
+ let ranNum: number = Math.floor(Math.random()*this.deck.length);
+ [this.deck[i], this.deck[ranNum]] = [this.deck[ranNum],this.deck[i]];
+ }
+ }
+}
+
+// checking if file works
+var deck;
+deck = new Deck();
+deck.newDeck();
+console.log(deck);
diff --git a/classes/CasinoPlayer.js b/classes/CasinoPlayer.js
new file mode 100644
index 00000000..f4f50ce8
--- /dev/null
+++ b/classes/CasinoPlayer.js
@@ -0,0 +1,25 @@
+"use strict";
+exports.__esModule = true;
+var CasinoPlayer = /** @class */ (function () {
+ function CasinoPlayer(name, balance) {
+ this.name = name;
+ this.balance = balance;
+ }
+ CasinoPlayer.prototype.getName = function () {
+ return this.name;
+ };
+ CasinoPlayer.prototype.getBalance = function () {
+ return this.balance;
+ };
+ CasinoPlayer.prototype.getHand = function () {
+ return this.hand;
+ };
+ CasinoPlayer.prototype.setBalance = function (amount) {
+ this.balance = amount;
+ };
+ CasinoPlayer.prototype.addBalance = function (amount) {
+ this.balance += amount;
+ };
+ return CasinoPlayer;
+}());
+exports.CasinoPlayer = CasinoPlayer;
diff --git a/classes/CasinoPlayer.ts b/classes/CasinoPlayer.ts
new file mode 100644
index 00000000..53d5c5a0
--- /dev/null
+++ b/classes/CasinoPlayer.ts
@@ -0,0 +1,37 @@
+import {Card} from "./CardUtils/Card";
+
+export class CasinoPlayer{
+
+ name: string;
+ hand: Card[];
+ balance: number;
+
+
+ constructor(name: string, balance: number) {
+
+ this.name = name;
+ this.balance = balance;
+ }
+
+ getName(): string {
+ return this.name;
+ }
+
+ getBalance(): number {
+ return this.balance;
+ }
+
+ getHand(): Card[] {
+ return this.hand;
+ }
+
+ setBalance(amount: number) {
+ this.balance = amount;
+ }
+
+ addBalance(amount: number) {
+ this.balance += amount;
+ }
+
+}
+
diff --git a/classes/UI.js b/classes/UI.js
new file mode 100644
index 00000000..48cb3758
--- /dev/null
+++ b/classes/UI.js
@@ -0,0 +1,28 @@
+"use strict";
+exports.__esModule = true;
+var UI = /** @class */ (function () {
+ function UI() {
+ UI.button.addEventListener("click", function (e) { UI.lastInput = UI.userInput.value; });
+ UI.button.addEventListener("click", function (e) { UI.userInput.value = ''; });
+ }
+ UI.display = function (input) {
+ this.window.innerText += input + '\n';
+ };
+ UI.clearScreen = function () {
+ this.window.innerText = '';
+ };
+ UI.getInstance = function () {
+ return this.instance || (this.instance = new UI());
+ };
+ UI.getlastInput = function () {
+ return this.lastInput;
+ };
+ UI.userInput = document.getElementById("user_input");
+ UI.window = document.getElementById('display');
+ UI.button = document.getElementById('submit');
+ return UI;
+}());
+exports.UI = UI;
+var UIInstance = UI.Instance;
+var App = new App();
+App.main();
diff --git a/classes/UI.ts b/classes/UI.ts
new file mode 100644
index 00000000..1f4ca9d6
--- /dev/null
+++ b/classes/UI.ts
@@ -0,0 +1,36 @@
+export class UI {
+ static Instance: any;
+
+ static userInput = document.getElementById("user_input");
+ static window = document.getElementById('display');
+ static button = document.getElementById('submit');
+ static lastInput: any;
+ private static instance: UI;
+
+ private constructor() {
+
+ UI.button.addEventListener("click", (e: Event) => { UI.lastInput = UI.userInput.value });
+ UI.button.addEventListener("click", (e: Event) => { UI.userInput.value = '' });
+ }
+
+ static display (input: any): void {
+ this.window.innerText += input + '\n';
+ }
+
+ static clearScreen (): void {
+ this.window.innerText = '';
+ }
+
+ public static getInstance(): UI {
+ return this.instance || (this.instance = new UI());
+ }
+
+ public static getlastInput(): any {
+ return this.lastInput;
+ }
+
+}
+
+const UIInstance = UI.Instance;
+var App = new App();
+App.main();
\ No newline at end of file
diff --git a/classes/blackjack/BjPlayer.js b/classes/blackjack/BjPlayer.js
new file mode 100644
index 00000000..0eba9b00
--- /dev/null
+++ b/classes/blackjack/BjPlayer.js
@@ -0,0 +1,52 @@
+"use strict";
+var __extends = (this && this.__extends) || (function () {
+ var extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+ return function (d, b) {
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ };
+})();
+exports.__esModule = true;
+var CardGamePlayer_1 = require("../CardGame/CardGamePlayer");
+var BjPlayer = /** @class */ (function (_super) {
+ __extends(BjPlayer, _super);
+ function BjPlayer(player) {
+ var _this = _super.call(this) || this;
+ _this.score = 0;
+ _this.player = player;
+ _this.score = 0;
+ return _this;
+ }
+ BjPlayer.prototype.displayScore = function () {
+ return document.getElementById("playerHand").innerHTML = "Player's Score: " + this.getScore();
+ };
+ BjPlayer.prototype.getScore = function () {
+ //start score with 0
+ this.score = 0;
+ //loop through the hand length and add each rank
+ for (var i = 0; i < _super.prototype.getHand.call(this).length; i++) {
+ this.score += _super.prototype.getHand.call(this)[i].getRank();
+ }
+ //if player has an ACE
+ if (this.aceInHand() && this.score <= 11) {
+ this.score += 10;
+ }
+ return this.score;
+ };
+ BjPlayer.prototype.aceInHand = function () {
+ //if player has an ace it can be an 11 or 1
+ for (var i = 0; i < _super.prototype.getHand.call(this).length; i++) {
+ if (_super.prototype.getHand.call(this)[i].getFace() == "ace") {
+ return true;
+ }
+ }
+ return false;
+ };
+ BjPlayer.prototype.calculateScore = function () {
+ };
+ return BjPlayer;
+}(CardGamePlayer_1.CardGamePlayer));
+exports.BjPlayer = BjPlayer;
diff --git a/classes/blackjack/BjPlayer.ts b/classes/blackjack/BjPlayer.ts
new file mode 100644
index 00000000..0f5ee65a
--- /dev/null
+++ b/classes/blackjack/BjPlayer.ts
@@ -0,0 +1,48 @@
+import {CasinoPlayer} from "../CasinoPlayer";
+import {CardGamePlayer} from "../CardGame/CardGamePlayer";
+
+export class BjPlayer extends CardGamePlayer {
+
+ private player : CasinoPlayer;
+ private score : number = 0;
+
+
+ constructor(player: CasinoPlayer){
+ super();
+ this.player = player;
+ this.score = 0;
+ }
+
+ displayScore(): any {
+
+ return document.getElementById("playerHand").innerHTML = "Player's Score: "+ this.getScore()
+ }
+
+ getScore(): number {
+ //start score with 0
+ this.score = 0;
+ //loop through the hand length and add each rank
+ for (let i = 0; i < super.getHand().length; i++) {
+ this.score += super.getHand()[i].getRank();
+ }
+ //if player has an ACE
+ if(this.aceInHand() && this.score <= 11){
+ this.score += 10;
+ }
+ return this.score;
+ }
+
+ aceInHand(): boolean {
+ //if player has an ace it can be an 11 or 1
+ for (let i = 0; i < super.getHand().length; i++) {
+ if(super.getHand()[i].getFace() == "ace"){
+ return true;
+ }
+ }
+ return false;
+ }
+
+ calculateScore() {
+
+ }
+}
\ No newline at end of file
diff --git a/classes/blackjack/BlackJack.js b/classes/blackjack/BlackJack.js
new file mode 100644
index 00000000..50089fd8
--- /dev/null
+++ b/classes/blackjack/BlackJack.js
@@ -0,0 +1,102 @@
+"use strict";
+///
+///
+///
+var __extends = (this && this.__extends) || (function () {
+ var extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+ return function (d, b) {
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ };
+})();
+exports.__esModule = true;
+var BjPlayer_1 = require("./BjPlayer");
+var Dealer_1 = require("./Dealer");
+var Deck_1 = require("../CardUtils/Deck");
+var CardGame_1 = require("../CardGame/CardGame");
+var BlackJack = /** @class */ (function (_super) {
+ __extends(BlackJack, _super);
+ function BlackJack(player, dealer) {
+ var _this = _super.call(this) || this;
+ _this.player = new BjPlayer_1.BjPlayer(player);
+ _this.dealer = new Dealer_1.Dealer(dealer);
+ return _this;
+ }
+ BlackJack.prototype.getPlayer = function () {
+ return this.player;
+ };
+ BlackJack.prototype.getDealer = function () {
+ return this.dealer;
+ };
+ BlackJack.prototype.start = function () {
+ console.log("GAME STARTED!");
+ this.deal(this.player, this.dealer, 2);
+ };
+ BlackJack.prototype.deal = function (player, dealer, number) {
+ this.player = new BjPlayer_1.BjPlayer(player);
+ this.dealer = new Dealer_1.Dealer(dealer);
+ };
+ BlackJack.prototype.hit = function () {
+ this.player.addCard(this.deck.pop());
+ this.checkForOver21();
+ };
+ BlackJack.prototype.stand = function () {
+ this.player.calculateScore();
+ this.dealerPlay();
+ this.checkForWin();
+ };
+ BlackJack.prototype.checkBalanceAmount = function () {
+ if (this.player.balance < 1) {
+ //exit game
+ }
+ };
+ BlackJack.prototype.checkForOver21 = function () {
+ this.player.calculateScore();
+ if (this.player.getScore() > 21) {
+ this.checkForWin();
+ this.dealer.calculateScore();
+ }
+ };
+ BlackJack.prototype.checkForWin = function () {
+ if (this.didPlayerWin()) {
+ //PLAYER WON
+ this.player.balance += (this.betAmount) * 1.5;
+ }
+ else {
+ //PLAYER LOST
+ this.player.balance -= this.betAmount;
+ }
+ };
+ BlackJack.prototype.didPlayerWin = function () {
+ var playerScore = this.player.getScore();
+ var dealerScore = this.dealer.getScore();
+ if ((playerScore == 21 && dealerScore != 21) ||
+ (playerScore < 21 && dealerScore < playerScore) ||
+ (playerScore < 21 && dealerScore > 21)) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ };
+ BlackJack.prototype.dealerPlay = function () {
+ this.dealer.calculateScore();
+ while (this.dealer.getScore() < 17) {
+ this.dealer.addCard(this.deck.pop());
+ this.dealer.calculateScore();
+ }
+ this.dealer.clearHand();
+ //display dealer hand
+ };
+ BlackJack.prototype.playAgain = function () {
+ new Deck_1.Deck();
+ this.start();
+ };
+ BlackJack.prototype.placeBet = function () {
+ };
+ return BlackJack;
+}(CardGame_1.CardGame));
+exports.BlackJack = BlackJack;
diff --git a/classes/blackjack/BlackJack.ts b/classes/blackjack/BlackJack.ts
new file mode 100644
index 00000000..c4f06c93
--- /dev/null
+++ b/classes/blackjack/BlackJack.ts
@@ -0,0 +1,108 @@
+///
+///
+///
+
+import {BjPlayer} from "./BjPlayer";
+import {CasinoPlayer} from "../CasinoPlayer";
+import {Dealer} from "./Dealer";
+import {Deck} from "../CardUtils/Deck";
+import {CardGame} from "../CardGame/CardGame";
+
+export class BlackJack extends CardGame {
+
+ player: BjPlayer;
+ dealer: Dealer;
+ betAmount: number;
+
+ getPlayer(): BjPlayer {
+ return this.player;
+ }
+
+ getDealer(): Dealer {
+ return this.dealer;
+ }
+
+ constructor (player, dealer) {
+ super();
+ this.player = new BjPlayer(player);
+ this.dealer = new Dealer (dealer);
+ }
+
+ start() {
+ console.log("GAME STARTED!")
+ this.deal(this.player, this.dealer, 2);
+ }
+
+ deal(player: BjPlayer, dealer: Dealer, number: number) {
+ this.player = new BjPlayer(player);
+ this.dealer = new Dealer(dealer);
+
+ }
+
+ hit() {
+ this.player.addCard(this.deck.pop());
+ this.checkForOver21();
+ }
+
+ stand() {
+ this.player.calculateScore();
+ this.dealerPlay();
+ this.checkForWin();
+ }
+
+ checkBalanceAmount() {
+ if (this.player.balance < 1) {
+ //exit game
+ }
+ }
+
+ checkForOver21() {
+ this.player.calculateScore();
+ if (this.player.getScore() > 21) {
+ this.checkForWin();
+ this.dealer.calculateScore();
+ }
+ }
+
+ checkForWin() {
+ if (this.didPlayerWin()) {
+ //PLAYER WON
+ this.player.balance += (this.betAmount) * 1.5;
+ } else {
+ //PLAYER LOST
+ this.player.balance -= this.betAmount;
+ }
+ }
+
+ didPlayerWin(): boolean {
+ let playerScore = this.player.getScore();
+ let dealerScore = this.dealer.getScore();
+ if ((playerScore == 21 && dealerScore != 21) ||
+ (playerScore < 21 && dealerScore < playerScore) ||
+ (playerScore < 21 && dealerScore > 21)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ dealerPlay() {
+ this.dealer.calculateScore();
+ while (this.dealer.getScore() < 17) {
+ this.dealer.addCard(this.deck.pop());
+ this.dealer.calculateScore();
+ }
+ this.dealer.clearHand();
+ //display dealer hand
+ }
+
+ playAgain() {
+ new Deck();
+ this.start();
+ }
+
+ placeBet() {
+
+ }
+
+}
\ No newline at end of file
diff --git a/classes/blackjack/Dealer.js b/classes/blackjack/Dealer.js
new file mode 100644
index 00000000..d3c0e915
--- /dev/null
+++ b/classes/blackjack/Dealer.js
@@ -0,0 +1,26 @@
+"use strict";
+///
+var __extends = (this && this.__extends) || (function () {
+ var extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+ return function (d, b) {
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ };
+})();
+exports.__esModule = true;
+var CasinoPlayer_1 = require("../CasinoPlayer");
+var BjPlayer_1 = require("./BjPlayer");
+var Dealer = /** @class */ (function (_super) {
+ __extends(Dealer, _super);
+ function Dealer(dealer) {
+ return _super.call(this, new CasinoPlayer_1.CasinoPlayer("Dealer", 100000000000000)) || this;
+ }
+ Dealer.prototype.hitDealer = function () {
+ return _super.prototype.getScore.call(this) < 17;
+ };
+ return Dealer;
+}(BjPlayer_1.BjPlayer));
+exports.Dealer = Dealer;
diff --git a/classes/blackjack/Dealer.ts b/classes/blackjack/Dealer.ts
new file mode 100644
index 00000000..614cad67
--- /dev/null
+++ b/classes/blackjack/Dealer.ts
@@ -0,0 +1,16 @@
+///
+
+import {CasinoPlayer} from "../CasinoPlayer";
+import {BjPlayer} from "./BjPlayer";
+
+export class Dealer extends BjPlayer{
+
+ constructor(dealer: CasinoPlayer){
+ super(new CasinoPlayer("Dealer", 100000000000000))
+ }
+
+ hitDealer(): boolean {
+ return super.getScore() < 17;
+ }
+
+}
\ No newline at end of file
diff --git a/images/deckOfCards/10C.png b/images/deckOfCards/10C.png
new file mode 100644
index 00000000..f9ade6df
Binary files /dev/null and b/images/deckOfCards/10C.png differ
diff --git a/images/deckOfCards/10D.png b/images/deckOfCards/10D.png
new file mode 100644
index 00000000..a9de67ee
Binary files /dev/null and b/images/deckOfCards/10D.png differ
diff --git a/images/deckOfCards/10H.png b/images/deckOfCards/10H.png
new file mode 100644
index 00000000..df551b0f
Binary files /dev/null and b/images/deckOfCards/10H.png differ
diff --git a/images/deckOfCards/10S.png b/images/deckOfCards/10S.png
new file mode 100644
index 00000000..22141df1
Binary files /dev/null and b/images/deckOfCards/10S.png differ
diff --git a/images/deckOfCards/2C.png b/images/deckOfCards/2C.png
new file mode 100644
index 00000000..413b0da3
Binary files /dev/null and b/images/deckOfCards/2C.png differ
diff --git a/images/deckOfCards/2D.png b/images/deckOfCards/2D.png
new file mode 100644
index 00000000..f966e483
Binary files /dev/null and b/images/deckOfCards/2D.png differ
diff --git a/images/deckOfCards/2H.png b/images/deckOfCards/2H.png
new file mode 100644
index 00000000..345744e2
Binary files /dev/null and b/images/deckOfCards/2H.png differ
diff --git a/images/deckOfCards/2S.png b/images/deckOfCards/2S.png
new file mode 100644
index 00000000..a0de1451
Binary files /dev/null and b/images/deckOfCards/2S.png differ
diff --git a/images/deckOfCards/3C.png b/images/deckOfCards/3C.png
new file mode 100644
index 00000000..f8b8183c
Binary files /dev/null and b/images/deckOfCards/3C.png differ
diff --git a/images/deckOfCards/3D.png b/images/deckOfCards/3D.png
new file mode 100644
index 00000000..cee21f39
Binary files /dev/null and b/images/deckOfCards/3D.png differ
diff --git a/images/deckOfCards/3H.png b/images/deckOfCards/3H.png
new file mode 100644
index 00000000..8494e1c4
Binary files /dev/null and b/images/deckOfCards/3H.png differ
diff --git a/images/deckOfCards/3S.png b/images/deckOfCards/3S.png
new file mode 100644
index 00000000..78e3b205
Binary files /dev/null and b/images/deckOfCards/3S.png differ
diff --git a/images/deckOfCards/4C.png b/images/deckOfCards/4C.png
new file mode 100644
index 00000000..89384590
Binary files /dev/null and b/images/deckOfCards/4C.png differ
diff --git a/images/deckOfCards/4D.png b/images/deckOfCards/4D.png
new file mode 100644
index 00000000..d9ae5bee
Binary files /dev/null and b/images/deckOfCards/4D.png differ
diff --git a/images/deckOfCards/4H.png b/images/deckOfCards/4H.png
new file mode 100644
index 00000000..41a44888
Binary files /dev/null and b/images/deckOfCards/4H.png differ
diff --git a/images/deckOfCards/4S.png b/images/deckOfCards/4S.png
new file mode 100644
index 00000000..70bc9cc3
Binary files /dev/null and b/images/deckOfCards/4S.png differ
diff --git a/images/deckOfCards/5C.png b/images/deckOfCards/5C.png
new file mode 100644
index 00000000..a7f49be9
Binary files /dev/null and b/images/deckOfCards/5C.png differ
diff --git a/images/deckOfCards/5D.png b/images/deckOfCards/5D.png
new file mode 100644
index 00000000..cff06170
Binary files /dev/null and b/images/deckOfCards/5D.png differ
diff --git a/images/deckOfCards/5H.png b/images/deckOfCards/5H.png
new file mode 100644
index 00000000..1efcbf35
Binary files /dev/null and b/images/deckOfCards/5H.png differ
diff --git a/images/deckOfCards/5S.png b/images/deckOfCards/5S.png
new file mode 100644
index 00000000..e7088069
Binary files /dev/null and b/images/deckOfCards/5S.png differ
diff --git a/images/deckOfCards/6C.png b/images/deckOfCards/6C.png
new file mode 100644
index 00000000..d8382d36
Binary files /dev/null and b/images/deckOfCards/6C.png differ
diff --git a/images/deckOfCards/6D.png b/images/deckOfCards/6D.png
new file mode 100644
index 00000000..7ba40e98
Binary files /dev/null and b/images/deckOfCards/6D.png differ
diff --git a/images/deckOfCards/6H.png b/images/deckOfCards/6H.png
new file mode 100644
index 00000000..93a84f84
Binary files /dev/null and b/images/deckOfCards/6H.png differ
diff --git a/images/deckOfCards/6S.png b/images/deckOfCards/6S.png
new file mode 100644
index 00000000..874162b2
Binary files /dev/null and b/images/deckOfCards/6S.png differ
diff --git a/images/deckOfCards/7C.png b/images/deckOfCards/7C.png
new file mode 100644
index 00000000..f6a9653a
Binary files /dev/null and b/images/deckOfCards/7C.png differ
diff --git a/images/deckOfCards/7D.png b/images/deckOfCards/7D.png
new file mode 100644
index 00000000..6c4393d7
Binary files /dev/null and b/images/deckOfCards/7D.png differ
diff --git a/images/deckOfCards/7H.png b/images/deckOfCards/7H.png
new file mode 100644
index 00000000..d4a59ffd
Binary files /dev/null and b/images/deckOfCards/7H.png differ
diff --git a/images/deckOfCards/7S.png b/images/deckOfCards/7S.png
new file mode 100755
index 00000000..895f85c0
Binary files /dev/null and b/images/deckOfCards/7S.png differ
diff --git a/images/deckOfCards/8C.png b/images/deckOfCards/8C.png
new file mode 100644
index 00000000..bc87bf04
Binary files /dev/null and b/images/deckOfCards/8C.png differ
diff --git a/images/deckOfCards/8D.png b/images/deckOfCards/8D.png
new file mode 100644
index 00000000..38c56952
Binary files /dev/null and b/images/deckOfCards/8D.png differ
diff --git a/images/deckOfCards/8H.png b/images/deckOfCards/8H.png
new file mode 100644
index 00000000..c2812aa1
Binary files /dev/null and b/images/deckOfCards/8H.png differ
diff --git a/images/deckOfCards/8S.png b/images/deckOfCards/8S.png
new file mode 100644
index 00000000..0277cc6b
Binary files /dev/null and b/images/deckOfCards/8S.png differ
diff --git a/images/deckOfCards/9C.png b/images/deckOfCards/9C.png
new file mode 100644
index 00000000..d81b2f28
Binary files /dev/null and b/images/deckOfCards/9C.png differ
diff --git a/images/deckOfCards/9D.png b/images/deckOfCards/9D.png
new file mode 100644
index 00000000..e0d3d05e
Binary files /dev/null and b/images/deckOfCards/9D.png differ
diff --git a/images/deckOfCards/9H.png b/images/deckOfCards/9H.png
new file mode 100644
index 00000000..7b679e1b
Binary files /dev/null and b/images/deckOfCards/9H.png differ
diff --git a/images/deckOfCards/9S.png b/images/deckOfCards/9S.png
new file mode 100644
index 00000000..f58493ec
Binary files /dev/null and b/images/deckOfCards/9S.png differ
diff --git a/images/deckOfCards/AC.png b/images/deckOfCards/AC.png
new file mode 100644
index 00000000..396c1581
Binary files /dev/null and b/images/deckOfCards/AC.png differ
diff --git a/images/deckOfCards/AD.png b/images/deckOfCards/AD.png
new file mode 100644
index 00000000..d702a394
Binary files /dev/null and b/images/deckOfCards/AD.png differ
diff --git a/images/deckOfCards/AH.png b/images/deckOfCards/AH.png
new file mode 100644
index 00000000..435fc140
Binary files /dev/null and b/images/deckOfCards/AH.png differ
diff --git a/images/deckOfCards/AS.png b/images/deckOfCards/AS.png
new file mode 100644
index 00000000..f07f67d8
Binary files /dev/null and b/images/deckOfCards/AS.png differ
diff --git a/images/deckOfCards/JC.png b/images/deckOfCards/JC.png
new file mode 100644
index 00000000..16418e4c
Binary files /dev/null and b/images/deckOfCards/JC.png differ
diff --git a/images/deckOfCards/JD.png b/images/deckOfCards/JD.png
new file mode 100644
index 00000000..05b03897
Binary files /dev/null and b/images/deckOfCards/JD.png differ
diff --git a/images/deckOfCards/JH.png b/images/deckOfCards/JH.png
new file mode 100644
index 00000000..259421cd
Binary files /dev/null and b/images/deckOfCards/JH.png differ
diff --git a/images/deckOfCards/JS.png b/images/deckOfCards/JS.png
new file mode 100644
index 00000000..6e0554d6
Binary files /dev/null and b/images/deckOfCards/JS.png differ
diff --git a/images/deckOfCards/KC.png b/images/deckOfCards/KC.png
new file mode 100644
index 00000000..70c4ee5c
Binary files /dev/null and b/images/deckOfCards/KC.png differ
diff --git a/images/deckOfCards/KD.png b/images/deckOfCards/KD.png
new file mode 100644
index 00000000..95a3b8fd
Binary files /dev/null and b/images/deckOfCards/KD.png differ
diff --git a/images/deckOfCards/KH.png b/images/deckOfCards/KH.png
new file mode 100644
index 00000000..0defcbb9
Binary files /dev/null and b/images/deckOfCards/KH.png differ
diff --git a/images/deckOfCards/KS.png b/images/deckOfCards/KS.png
new file mode 100644
index 00000000..43b8e198
Binary files /dev/null and b/images/deckOfCards/KS.png differ
diff --git a/images/deckOfCards/QC.png b/images/deckOfCards/QC.png
new file mode 100644
index 00000000..6f741777
Binary files /dev/null and b/images/deckOfCards/QC.png differ
diff --git a/images/deckOfCards/QD.png b/images/deckOfCards/QD.png
new file mode 100644
index 00000000..85c443fe
Binary files /dev/null and b/images/deckOfCards/QD.png differ
diff --git a/images/deckOfCards/QH.png b/images/deckOfCards/QH.png
new file mode 100644
index 00000000..ba8e1e42
Binary files /dev/null and b/images/deckOfCards/QH.png differ
diff --git a/images/deckOfCards/QS.png b/images/deckOfCards/QS.png
new file mode 100644
index 00000000..a6ef69f7
Binary files /dev/null and b/images/deckOfCards/QS.png differ
diff --git a/images/deckOfCards/red_back.png b/images/deckOfCards/red_back.png
new file mode 100644
index 00000000..759383d7
Binary files /dev/null and b/images/deckOfCards/red_back.png differ
diff --git a/images/logos/blackjack-21-live-casino.png b/images/logos/blackjack-21-live-casino.png
new file mode 100644
index 00000000..c17b3057
Binary files /dev/null and b/images/logos/blackjack-21-live-casino.png differ
diff --git a/index.html b/index.html
index d2c3c254..e6ecbd79 100644
--- a/index.html
+++ b/index.html
@@ -10,22 +10,23 @@
TypeScript Casino | Zipcode Wilmington
-
+
- TypeScript Casino
+Kay's Casino
+Lets gamble on whether the submit button works!
-
+
-
+
-