From cf34e0ae7f31d0f834b94a873b3cd898183c0c99 Mon Sep 17 00:00:00 2001 From: Priscila Heller Date: Mon, 3 Jul 2017 17:25:03 -0400 Subject: [PATCH 1/2] Added my name to the README.md file --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 45aa284..8a5ab77 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,4 @@ assignment_ruby_warmup Dice, dice, baby. [A Ruby assignment from the Viking Codes School](http://www.vikingcodeschool.com) +by Priscila Heller From e6901542945a8fcf06c972d0e20a9504adb91acf Mon Sep 17 00:00:00 2001 From: Priscila Heller Date: Tue, 18 Jul 2017 17:41:59 -0400 Subject: [PATCH 2/2] first attempt at dice_roll --- dice_roll.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 dice_roll.rb diff --git a/dice_roll.rb b/dice_roll.rb new file mode 100644 index 0000000..3c220d2 --- /dev/null +++ b/dice_roll.rb @@ -0,0 +1,13 @@ +possible_outcome1 = [1,2,3,4,5,6] +print "How many dice would you like to roll? " +dice_to_be_rolled = gets.chomp.to_s +case dice_to_be_rolled +when "1" + puts possible_outcome1[rand(possible_outcome1.length)] +when "2" + puts possible_outcome1[rand(possible_outcome1.length)] + possible_outcome1[rand(possible_outcome1.length)] +when "3" + puts possible_outcome1[rand(possible_outcome1.length)] + possible_outcome1[rand(possible_outcome1.length)] + possible_outcome1[rand(possible_outcome1.length)] +else + puts "You can choose to roll 1, 2 or 3 dice. Good Luck!" +end