From f45bbe2ef506794267d177843bed5861bdf7b1ab Mon Sep 17 00:00:00 2001 From: threetreeslight Date: Wed, 24 Jul 2019 20:54:18 +0900 Subject: [PATCH] gochi feat. tararico --- game.rb | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/game.rb b/game.rb index 9980e26..f6ec65a 100644 --- a/game.rb +++ b/game.rb @@ -12,7 +12,7 @@ class Game def main result = roll - asset(result) + puts asset(result) end def roll @@ -41,11 +41,23 @@ def assert(demes) return "loose" else deme = demes.combination(2).select{|a,b| a == b}.flatten.first - if deme == 1 - return "loose" + nokorideme = demes - deme + + if nokorideme == 1 + return "deme1" + elsif nokorideme == 2 + return "deme2" + elsif nokorideme == 3 + return "deme3" + elsif nokorideme == 4 + return "deme4" + elsif nokorideme == 5 + return "deme5" else - if demes.uniq.size == 2 + return "deme6" end + + end end end