EXERCISE
Play craps (roll two dice).
When executed, this program should print out two random numbers, one on each line, simulating the roll of two dice. Set two variables, with names that make sense, then write them out to the screen. Show the total as well.

HINTS
Get a random number between 1 and 6 by doing:
rand(1..6)
Log output to the screen with puts:
puts "Hello, world"

The first step is to assign a random value using rand(1..6) to a variable representing the first die rolled:

die1 = rand(1..6)
puts die1

rand is a built-in ruby method that returns a random number from the range of numbers passed to it as a parameter in the parentheses (e.g. 1..6).

The second step is to assign another random value to a second variable representing the second die rolled:

die2 = rand(1..6)
puts die2

We could name these variables a and b or anything else, but it's important do use descriptive variables in our code - it will help our future selves and our colleagues understand the intention of the code.  That clarify of intention will make it easier to modify or fix it later.

The third and last step is to calculate the total of the 2 dice rolled and display it:

total = die1 + die2
puts "The total is #{total}"

We're using string interpolation to embed the total value into a string.

All together it looks like this:

die1 = rand(1..6)
puts die1

die2 = rand(1..6)
puts die2

total = die1 + die2
puts "The total is #{total}"