Skip to content

Instantly share code, notes, and snippets.

View AnnemarieWegley's full-sized avatar

Annemarie AnnemarieWegley

View GitHub Profile
<script>
var random, result;
var findDifference = function(answer, guess) {
if (answer > guess) {
return answer - guess;
}
else {
return guess - answer;
}
}
<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) {
<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;
<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));