Created
June 4, 2012 00:25
-
-
Save jorydotcom/2865606 to your computer and use it in GitHub Desktop.
JS Pogs player object
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
//Player object with number and total of Pogs properties | |
var Player = function() { | |
this.name = prompt("What is your name?"); | |
this.totalPogs = 25; | |
this.numPogs = 0; | |
while (this.numPogs > this.totalPogs || this.numPogs <= 0) { | |
this.numPogs = parseInt(prompt("How many pogs would you like to play with, " + this.name + "? Pick a number between 0 and " + this.totalPogs + "."), 10); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment