Skip to content

Instantly share code, notes, and snippets.

@jorydotcom
Created June 4, 2012 00:25
Show Gist options
  • Save jorydotcom/2865606 to your computer and use it in GitHub Desktop.
Save jorydotcom/2865606 to your computer and use it in GitHub Desktop.
JS Pogs player object
//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