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 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