From b57d019e9fa8b8f31b3b34f484b69bf58eeefbf2 Mon Sep 17 00:00:00 2001 From: Steven Nunez Date: Thu, 24 Apr 2014 18:13:52 -0400 Subject: [PATCH 1/2] Solution --- dice_roll.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dice_roll.rb b/dice_roll.rb index a5bc106..9c2577d 100644 --- a/dice_roll.rb +++ b/dice_roll.rb @@ -3,5 +3,5 @@ # Feel free to google "how to generate a random number in ruby" def roll - # code goes here + rand(1..6) end From f50c21d89cc6040f409a01861c63378ec557dbae Mon Sep 17 00:00:00 2001 From: deniznida Date: Mon, 3 Aug 2015 11:35:11 -0400 Subject: [PATCH 2/2] adds TUTORIAL.md --- TUTORIAL.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 TUTORIAL.md diff --git a/TUTORIAL.md b/TUTORIAL.md new file mode 100644 index 0000000..a2f1a50 --- /dev/null +++ b/TUTORIAL.md @@ -0,0 +1,13 @@ +# Guide to Solving Dice Roll + +When we look into our `dice-roll.rb` file we see that there is already a method defined for us. Lets write our method that will a random number between 1 and 6. + +```ruby +def roll + rand(1..6) +end +``` + +`rand(1..6)` will give us every time a random number between the number 1 and 6 including the 6. + +All the four tests should be passing now. \ No newline at end of file