forked from alexpelan/ScriptEdBasketball
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasketball.js
More file actions
32 lines (29 loc) · 673 Bytes
/
basketball.js
File metadata and controls
32 lines (29 loc) · 673 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var promptForPlayerName = function (playerNumber) {
var name = prompt(playerNumber + " what is your name?");
if (name.length > 15)
alert("Wow thats a long name!");
return name;
};
var tryTwoPointShot = function (){
var randOne = Math.random();
var randTwo = Math.random();
if (randOne > 0.2 && randTwo > 0.2){
return true;
}
else {
return false;}
};
var tryThreePointShot = function (){
var randOne = Math.random();
var randTwo = Math.random();
if (randOne <= 0.2){
return true;
}
else if (randTwo >= 0.8){
return true;
}
else{
return false;
}
}
var getShotString