Created
June 2, 2014 13:53
-
-
Save essejose/8ee2fa3000fd1bbfbc18 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
// REQUIRED | |
function getRandom(x, y) { | |
return Math.floor(Math.random() * (y - x + 1)) + x | |
} | |
// | |
var print = function (val) { | |
var cartas = ['carta1','carta2','carta3','carta4','carta5', 'carta6'] | |
alert(cartas[val]) | |
} | |
// Function Call | |
print(getRandom(0, 5)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment