Before you arrive for the class, you must do the following:
If you already have Node.js version v0.6.0 or higher (you can check this by running node --version
at the command line), you can skip this step.
//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); | |
} | |
}; |
//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); | |
} | |
}; | |
//Creates player 1 |
//Pogs object | |
var Pogs = function() { | |
this.gameSet = player1.numPogs + player2.numPogs; | |
}; |
//Updates player pog totals to initialize game | |
var updatePogCount = function(player) { | |
player.totalPogs = player.totalPogs - player.numPogs; | |
return player.totalPogs; | |
}; |
// Add an else statement in case the number is divisible by 5. | |
// for the numbers 1 through 20, | |
for (i=1; i<=20; i++) { | |
if ( i % 3 === 0 ) { | |
if (i % 5 === 0) { | |
console.log("FizzBuzz"); | |
} else { | |
console.log("Fizz"); | |
} |
//Also from https://gist.github.com/3164584 | |
//My first attempt to solve Problem 2: | |
function watWord(num) { | |
switch (num) { | |
case 1: | |
return "one"; | |
case 2: | |
return "two"; | |
case 3: | |
return "three"; |
function watWord(num) { | |
switch (num) { | |
case 1: | |
return "one"; | |
case 2: | |
return "two"; | |
case 3: | |
return "three"; | |
case 4: | |
return "four"; |
function Egg (type, grade, shape, color, size, count) { | |
this.type = type, | |
this.grade = grade; | |
this.shape = shape; | |
this.color = color; | |
this.size = size; | |
} |
<div style="width:100%; text-align:left;" ><iframe src="http://www.eventbrite.com/tickets-external?eid=6064877211&ref=etckt&v=2" frameborder="0" height="317" width="100%" vspace="0" hspace="0" marginheight="5" marginwidth="5" scrolling="auto" allowtransparency="true"></iframe><div style="font-family:Helvetica, Arial; font-size:10px; padding:5px 0 5px; margin:2px; width:100%; text-align:left;" ><a style="color:#ddd; text-decoration:none;" target="_blank" href="http://www.eventbrite.com/r/etckt">Online event registration</a><span style="color:#ddd;"> for </span><a style="color:#ddd; text-decoration:none;" target="_blank" href="http://www.eventbrite.com/event/6064877211?ref=etckt">TXJS JavaScript Best Practices Training</a> <span style="color:#ddd;">powered by</span> <a style="color:#ddd; text-decoration:none;" target="_blank" href="http://www.eventbrite.com?ref=etckt">Eventbrite</a></div></div> |