This file contains hidden or 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
<script> | |
function Money() { | |
this.coins = []; | |
this.count = function() { | |
return this.coins.length; | |
} | |
this.init = function() { | |
for (a = 1; a <= 25; a++) { | |
for (t = 1; t <= 4; t++) { | |
this.coins.push(new Coin(a, t)); |
This file contains hidden or 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
<script> | |
var owl, cat, min; | |
function Animal(name, speed, focus) { | |
this.name= name; | |
this.speed=speed; | |
this.focus= focus; | |
this.position= 0; | |
this.run= function() { | |
if(Math.random() *10 < this.focus) { | |
this.position= this.position + this.speed; |
This file contains hidden or 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
<script> | |
var owl, cat; | |
owl= alert("Guess who will the tootsie pop contest, Owl or Cat?"); | |
function Animal(name, speed, focus, min){ | |
this.name= name; | |
this.speed=speed; | |
this.position=0; | |
this.focus= focus; | |
this.run= function(){ | |
if(Math.random() *10 < this.focus) { |
This file contains hidden or 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
<script> | |
var random, result; | |
var findDifference = function(answer, guess) { | |
if (answer > guess) { | |
return answer - guess; | |
} | |
else { | |
return guess - answer; | |
} | |
} |