Skip to content

Conversation

@rani-i3
Copy link
Owner

@rani-i3 rani-i3 commented Aug 30, 2023

No description provided.

@@ -0,0 +1,46 @@
require 'date'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

カレンダーのプログラムがPRに混じってしまっていますね。新しいブランチを作成する際は、今どのブランチにいるのかに注意して作成するようにしましょう。今回はこのままでOKです。

end

frames = []
shots.each_slice(2) do |s|
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここは以下のように書けますね。

frames = shots.each_slice(2).to_a

# binding.break
if index >=9
point += frame.sum
# elsif frame_index == 11
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不要であれば削除しておきましょう。3行↑にある binding.break も同様です。

shots.each_slice(2) do |s|
frames << s
end
p frames
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

デバッグ用だと思うので、削除しておきましょう。

p frames
point = 0

frames.each_with_index do |frame, index|
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここは以下のように Enumerable#sum を使うと、自分で point を加算しなくて良くなるはずです。

point = frames.each_with_index.sum do |frame, index|
  # 戻り値を各フレームのスコアにする
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants