-
-
Save devinrhode2/5523651 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var suits = ['Heart', 'Diamond', 'Club', 'Spade']; | |
var value = ['2','3','4','5','6','7','8','9','10','J','Q','K','A']; | |
function Card(num, suit) { | |
this.num = num; | |
this.suit = suit; | |
} | |
function Deck() { | |
this.cards = []; | |
} | |
Deck.prototype = { | |
// shuffle: function() { | |
// this.cards.sort(){ return Math.floor(Math.random()*3-1)}; | |
// }, | |
// ***** CANNOT GET SAMPLE TO RETURN WITHOUT SYNTAX ERRORS ***** | |
make: function() { | |
for(var i = 0; i < suit.length; i++) { | |
for(var j = 0; j < value.length; j++){ | |
var card = new Card(value[j], suit[i]); | |
this.cards.push(card); | |
} | |
} | |
} | |
}; | |
var deck1 = new Deck(); | |
deck1.make(); | |
console.log(deck1.cards); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment