-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.js
More file actions
26 lines (23 loc) · 776 Bytes
/
code.js
File metadata and controls
26 lines (23 loc) · 776 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
function play() { <This is to run the command>
var die1 = 5 <This is a defanition to give the command a dice function and the value to it.
var die2 = 2
var sum = die1+die2 <This is the run command to run the program>
document.write("Die 1 = " + die1)
document.write("<br/>")
document.write("Die 2 = " + die2)
document.write("<br/>")
document.write("Sum = " + sum)
document.write("<br/>") <This is the out put of the code and what its told to do>
if (sum == 7 || sum == 11) <This is the if this then this command>
{ document.write("CRAPS - you lose")
document.write("<br/>")
}
else if (die1== die2 && die1%2 == 0)
{
document.write("DOUBLES - you win")
document.write("<br/>")
}
}
document.write("Simple Craps")
document.write("<br/>")
play()