From 1fd63649f61e97d8cf87ecf67c586b17b6df726a Mon Sep 17 00:00:00 2001 From: s00ner Date: Fri, 2 Dec 2022 16:15:20 -0500 Subject: [PATCH] fized formatting --- day02/solution.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/day02/solution.rb b/day02/solution.rb index a3cbb5d..c8ba723 100644 --- a/day02/solution.rb +++ b/day02/solution.rb @@ -1,4 +1,6 @@ #!/bin/env ruby +# frozen_string_literal: true + require 'pry' def score(opponent, me) @@ -13,9 +15,9 @@ def score(opponent, me) return 3 + base if opponent == me outcome = 0 - outcome = 6 if opponent == :rock and me == :paper - outcome = 6 if opponent == :paper and me == :scissors - outcome = 6 if opponent == :scissors and me == :rock + outcome = 6 if (opponent == :rock) && (me == :paper) + outcome = 6 if (opponent == :paper) && (me == :scissors) + outcome = 6 if (opponent == :scissors) && (me == :rock) outcome + base end