Skip to content

「繰り返し」の節の演習問題1の別解を削除#935

Open
chvmvd wants to merge 1 commit intomainfrom
fix-loop-exercise
Open

「繰り返し」の節の演習問題1の別解を削除#935
chvmvd wants to merge 1 commit intomainfrom
fix-loop-exercise

Conversation

@chvmvd
Copy link
Contributor

@chvmvd chvmvd commented Mar 7, 2026

複合代入演算子を使用した例を別解として載せていましたが、for文を導入する際の説明で複合代入演算子が使用されているため、解答例でも複合代入演算子を使用することにし別解については削除しました。

@cloudflare-workers-and-pages
Copy link

Deploying utcode-learn with  Cloudflare Pages  Cloudflare Pages

Latest commit: 29747f6
Status: ✅  Deploy successful!
Preview URL: https://dfdf9c6a.utcode-learn.pages.dev
Branch Preview URL: https://fix-loop-exercise.utcode-learn.pages.dev

View logs

@chvmvd chvmvd marked this pull request as ready for review March 7, 2026 02:41
@chvmvd chvmvd requested a review from Copilot March 7, 2026 02:41
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

「繰り返し」章(ループ)の演習問題1について、解答例を複合代入演算子を使う版に統一し、別解として載せていた非複合代入の例を削除するPRです。

Changes:

  • 演習問題1(10の階乗)の解答から「別解」セクションを削除し、表示する ViewSource を _samples/product に統一
  • _samples/product の実装を i += 1 / product *= i を用いた内容に更新
  • _samples/product-alt サンプル一式を削除

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
docs/1-trial-session/10-loop/index.mdx 演習問題1の解答例を複合代入演算子の版に一本化し、参照サンプルも統一
docs/1-trial-session/10-loop/_samples/product/script.js ループ更新式と積の更新を複合代入演算子ベースに変更
docs/1-trial-session/10-loop/_samples/product-alt/script.js 別解サンプル削除
docs/1-trial-session/10-loop/_samples/product-alt/index.html 別解サンプル削除

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@Yokomi422
Copy link
Contributor

Yokomi422 commented Mar 7, 2026

#927 がマージされた場合、複合代入演算子の初出はここということになりますか。そうすると複合代入演算子の説明がなくなってしまいませんか。
https://github.com/ut-code/utcode-learn/pull/927/changes#r2863183478

@chvmvd
Copy link
Contributor Author

chvmvd commented Mar 7, 2026

#927 がマージされた場合、複合代入演算子の初出はここということになりますか。そうすると複合代入演算子の説明がなくなってしまいませんか。 https://github.com/ut-code/utcode-learn/pull/927/changes#r2863183478

今回の差分の箇所よりも前の箇所であるfor文を導入する箇所ですでに複合代入演算子が使われており、この演習問題はそれを利用しただけなので、問題ないはずです。

cf.

for (let i = 0; i < 5; i += 1) {

@Yokomi422
Copy link
Contributor

確かに複合代入演算子の今回の修正よりも前に出てきているけど、#927 で複合代入演算子の説明を消すと複合代入演算子がいきなり登場してしまう気がします。

image

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.

4 participants