Created
June 16, 2014 14:07
-
-
Save AnnemarieWegley/1df39f803fd1c4190d61 to your computer and use it in GitHub Desktop.
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)); | |
} | |
} | |
} | |
} | |
function Coin(amount, type) { | |
this.amount = amount; | |
this.type = type; | |
this.show = function() { | |
console.log(this.amount + " of " + this.type); | |
} | |
} | |
m = new Money(); | |
m.init(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment