Skip to content

ボウリングプログラムを作成しました。#3

Open
s-tone-gs wants to merge 4 commits intomainfrom
bowling
Open

ボウリングプログラムを作成しました。#3
s-tone-gs wants to merge 4 commits intomainfrom
bowling

Conversation

@s-tone-gs
Copy link
Copy Markdown
Owner

実行部分がメソッドに埋もれてしまっていたのでファイルを分割してあります。
レビューをお願いします。

Copy link
Copy Markdown

@yoshitsugu yoshitsugu left a comment

Choose a reason for hiding this comment

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

おおむねよさそうに思いました 👍 命名についてコメントしています。

converted_array
end

def format_score(raw_scores)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

format というと何か構造をもったもの(たとえばDate型の日付情報など)を文字列(2025-08-07など)に変換する処理を指すことが多いです。これはどちらかというと逆ですよね。
この場合はたとえば parse_scores とか to_int_scores(scores_string) みたいな感じになるかなと思います。

Copy link
Copy Markdown
Owner Author

@s-tone-gs s-tone-gs Aug 7, 2025

Choose a reason for hiding this comment

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

誤解を生む可能性がある命名であったため修正にて反映しました

formatはそのような場面で使用されるのですね(;'∀')
知らなかったですありがとうございます!

@@ -0,0 +1,61 @@
# frozen_string_literal: true

def strings_to_numbers(scores)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

このメソッド名だとただ文字列を数値にしているように見えるので、ボウリングのスコアのコンテキストでしか使えないものだと明示するような名前のほうがよいかなと思います。

Copy link
Copy Markdown
Owner Author

@s-tone-gs s-tone-gs Aug 7, 2025

Choose a reason for hiding this comment

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

Copy link
Copy Markdown

@yoshitsugu yoshitsugu left a comment

Choose a reason for hiding this comment

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

OKです!

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.

2 participants