Skip to content

Conversation

@potrue
Copy link
Owner

@potrue potrue commented Aug 28, 2025

@potrue
Copy link
Owner Author

potrue commented Aug 28, 2025

そういえば、これで60問解き終わりました。今までレビューしてくださった方ありがとうございます🙏

}
return result;
}
};

Choose a reason for hiding this comment

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

各行でindexを計算するの面白いですね。ですがやや複雑で、個人的には一番上に書かれたパターンが読みやすいと思いました。

}
}
}
next_row: ;

Choose a reason for hiding this comment

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

ラベルのインデントは一番浅い位置にする印象があります(例:CPython)。ただスタイルガイドに記載はないようです。

Copy link
Owner Author

Choose a reason for hiding this comment

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

ラベルのインデントスタイルは意識していませんでした。ありがとうございます。

result.push_back(s[index]);
index += cycle_length;
} else {
goto next_row;
Copy link

Choose a reason for hiding this comment

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

goto はあまり見ないように思います。理由として、濫用するとスパゲティコードになりやすいからだと思います。かなり深い最内周ループから関数の最後に飛びたいといった極めて限定的な個所では、使う場合もあるかもしれません。原則避けたほうが無難だと思います。

Copy link

Choose a reason for hiding this comment

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

goto を使いたくなったら、大抵、もう少し整えられます。
たとえば、この場合だったら while (true) を関数にして、goto を return にしたほうがいいのではないでしょうか。

Copy link
Owner Author

Choose a reason for hiding this comment

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

あ、たしかにその方がよさそうですね。ありがとうございます。

Copy link

@ryosuketc ryosuketc left a comment

Choose a reason for hiding this comment

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

特に追加のコメントはありませんでしたが、60 問おつかれさまでした!

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.

6 participants