Here is my game, based on what we’ve learned.
Oh, yeah, you can’t win the game, but you enjoy feeding the fox
Anyways, please give it a go. Any thoughts are welcome!
var feed = true;
var foxEats = Math.floor(Math.random()*2);
var chickenPies = Math.floor(Math.random()*5+1);
var hunger = 7;
while (feed) {
if (foxEats) {
console.log("You fed the fox " + chickenPies + " chicken pies.");
hunger-=chickenPies;
if (hunger<0) {
console.log("The fox ate " + hunger + " pies too many. You've overfed your fox! It's fat, rolling in the garden.");
feed=false;
} else {
foxEats = Math.floor(Math.random()*2);}
}else{
console.log("The fox loved your pies and it could eat another " + hunger);
confirm ("Feed more?");
foxEats = Math.floor(Math.random()*2);
}
}