From 22e4476cad91f55029674035ae274dc00bd4700d Mon Sep 17 00:00:00 2001 From: shoma Date: Mon, 28 Jul 2025 12:00:22 +0900 Subject: [PATCH 1/4] =?UTF-8?q?FizzBuzz=E3=82=92=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 01.fizzbuzz/fizzbuzz.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 01.fizzbuzz/fizzbuzz.rb diff --git a/01.fizzbuzz/fizzbuzz.rb b/01.fizzbuzz/fizzbuzz.rb new file mode 100644 index 0000000000..63678ee2aa --- /dev/null +++ b/01.fizzbuzz/fizzbuzz.rb @@ -0,0 +1,12 @@ +(1..20).to_a.each do |number| + case + when number % 15 == 0 + puts "FizzBuzz" + when number % 5 == 0 + puts "Buzz" + when number % 3 == 0 + puts "Fizz" + else + puts number + end +end From cbcb99ec309d10dd44a1415ce33067b99527e1db Mon Sep 17 00:00:00 2001 From: shoma Date: Mon, 28 Jul 2025 13:23:33 +0900 Subject: [PATCH 2/4] =?UTF-8?q?rubocop=E3=81=AE=E4=BF=AE=E6=AD=A3=E6=8F=90?= =?UTF-8?q?=E6=A1=88=E3=82=92=E5=8F=8D=E6=98=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 01.fizzbuzz/fizzbuzz.rb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/01.fizzbuzz/fizzbuzz.rb b/01.fizzbuzz/fizzbuzz.rb index 63678ee2aa..99011059b8 100644 --- a/01.fizzbuzz/fizzbuzz.rb +++ b/01.fizzbuzz/fizzbuzz.rb @@ -1,12 +1,11 @@ (1..20).to_a.each do |number| - case - when number % 15 == 0 - puts "FizzBuzz" - when number % 5 == 0 - puts "Buzz" - when number % 3 == 0 - puts "Fizz" + if (number % 15).zero? + puts 'FizzBuzz' + elsif (number % 5).zero? + puts 'Buzz' + elsif (number % 3).zero? + puts 'Fizz' else puts number end -end +end From 775a3c91b0e19e553b5b08931fea2c113941c1fa Mon Sep 17 00:00:00 2001 From: shoma Date: Mon, 28 Jul 2025 13:25:18 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E6=9C=AB=E5=B0=BE=E3=81=AB=E6=94=B9=E8=A1=8C=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 01.fizzbuzz/fizzbuzz.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/01.fizzbuzz/fizzbuzz.rb b/01.fizzbuzz/fizzbuzz.rb index 99011059b8..f9010c4fcf 100644 --- a/01.fizzbuzz/fizzbuzz.rb +++ b/01.fizzbuzz/fizzbuzz.rb @@ -9,3 +9,4 @@ puts number end end + From 815a3f1979a33a05eac331b3a1ea2010bbb3461d Mon Sep 17 00:00:00 2001 From: shoma Date: Fri, 1 Aug 2025 11:27:55 +0900 Subject: [PATCH 4/4] =?UTF-8?q?=E5=86=97=E9=95=B7=E3=81=AA=E6=A7=8B?= =?UTF-8?q?=E6=96=87=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 01.fizzbuzz/fizzbuzz.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/01.fizzbuzz/fizzbuzz.rb b/01.fizzbuzz/fizzbuzz.rb index f9010c4fcf..26c8ef4a9d 100644 --- a/01.fizzbuzz/fizzbuzz.rb +++ b/01.fizzbuzz/fizzbuzz.rb @@ -1,4 +1,4 @@ -(1..20).to_a.each do |number| +(1..20).each do |number| if (number % 15).zero? puts 'FizzBuzz' elsif (number % 5).zero?