Skip to content

Commit 620a4f5

Browse files
committed
ch02-00 数当てゲームの和訳をアップデート
1 parent f587d65 commit 620a4f5

File tree

1 file changed

+25
-30
lines changed

1 file changed

+25
-30
lines changed

src/ch02-00-guessing-game-tutorial.md

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ fundamentals.
1616
実践的なプロジェクトに一緒に取り組むことで、Rustの世界に飛び込んでみましょう!
1717
この章ではRustの一般的な概念を、実際のプログラムでの使い方を示しながら紹介します。
1818
`let``match`、メソッド、関連関数、外部クレートの使用などについて学びます!
19-
後続の章では、これらの概念をより詳しく掘り下げていきます。
20-
この章では基本的なことを練習します。
19+
それらの詳細については後続の章で取り上げますので、この章では基礎部分だけを練習しましょう。
2120

2221
<!--
2322
We’ll implement a classic beginner programming problem: a guessing game. Here’s
@@ -113,10 +112,10 @@ the next one.
113112
-->
114113

115114
このゲーム(の開発)では各イテレーションを素早くテストしてから、次のイテレーションに移ります。
116-
`run`コマンドは、今回のようにイテレーションを素早く回したいときに便利です
115+
`run`コマンドは、今回のようにプロジェクトのイテレーションを素早く回したいときに便利です
117116

118117
> 訳注:ここでのイテレーションは、アジャイル開発など、一連の工程を短期間で繰り返す開発手法で用いられている用語です。
119-
> イテレーションは、短い開発工程の「一回のサイクル」のことです。
118+
> イテレーションとは、開発工程の「一回のサイクル」のことです。
120119
>
121120
> この章では「実装」→「テスト」のサイクルを繰り返すことで、プログラムに少しずつ機能を追加していきます。
122121
@@ -273,10 +272,10 @@ detail in the [“Variables and Mutability”][variables-and-mutability] section
273272
variable name:
274273
-->
275274

276-
この行では`foo`という名前の新しい変数を作成し、`bar`の値に束縛しています
277-
Rustでは、変数は標準で不変(immutable)です。この概念について詳しくは、
278-
第3章の「変数と可変性」節で議論します。以下の例には、
279-
変数名の前に`mut`をつけて変数を可変にする方法が示されています:
275+
この行では`apples`という名前の新しい変数を作成し、`5`という値に束縛しています
276+
Rustでは、変数は標準で不変immutableです。
277+
この概念について詳しくは、第3章の[「変数と可変性」][variables-and-mutability]の節で議論します。
278+
以下の例には、変数名の前に`mut`をつけて変数を可変にする方法が示されています:
280279

281280
```rust,ignore
282281
let apples = 5; // immutable
@@ -868,13 +867,11 @@ has released the two new versions `0.8.4` and `0.9.0` you would see the
868867
following if you ran `cargo update`:
869868
-->
870869

871-
クレートを*本当に*アップグレードする必要が出てきたら、Cargoは別のコマンド(`update`)を提供します。
872-
これは、*Cargo.lock*ファイルを無視して、*Cargo.toml*ファイル内の全ての指定に合致する最新バージョンを計算します。
873-
それがうまくいったら、Cargoはそれらのバージョンを*Cargo.lock*ファイルに記述します。
874-
しかし標準でCargoは、`0.3.0`より大きく、`0.4.0`未満のバージョンのみを検索します。
875-
`rand`クレートの新バージョンが2つリリースされていたら(`0.3.15``0.4.0`だとします)、
876-
`cargo update`コマンドを走らせた時に以下のようなメッセージを目の当たりにするでしょう:
877-
870+
クレートを*本当に*アップグレードしたくなったときのために、Cargoは`update`コマンドを提供します。
871+
このコマンドは、*Cargo.lock*ファイルを無視して、*Cargo.toml*ファイル内の全ての指定に適合する最新バージョンを算出します。
872+
それがうまくいったら、Cargoはそれらのバージョンを*Cargo.lock*ファイルに記録します。
873+
ただし、デフォルトでCargoは、`0.8.3`以上、`0.9.0`未満のバージョンのみを検索します。
874+
もし`rand`クレートの新しいバージョンとして`0.8.4``0.9.0`の二つがリリースされていたなら、`cargo update`を実行したときに以下のようなメッセージが表示されるでしょう。
878875

879876
```console
880877
$ cargo update
@@ -892,10 +889,9 @@ the `0.9.x` series, you’d have to update the *Cargo.toml* file to look like
892889
this instead:
893890
-->
894891

895-
この時点で、*Cargo.lock*ファイルに書かれている現在使用している`rand`クレートのバージョンが、
896-
`0.3.15`になっていることにも気付くでしょう。
897-
`rand`のバージョン`0.4.0`または、`0.4.x`シリーズのどれかを使用したかったら、
898-
代わりに*Cargo.toml*ファイルを以下のように更新しなければならないでしょう:
892+
Cargoは`0.9.0`リリースを無視します。
893+
またそのとき、*Cargo.lock*ファイルに、現在使用している`rand`クレートのバージョンが`0.8.4`であることを示す変更があることにも気づくでしょう。
894+
そうではなく、`rand`のバージョン`0.9.0`または、`0.9.x`系のどれかを使用するには、*Cargo.toml*ファイルを以下のように変更する必要があるでしょう。
899895

900896
```toml
901897
[dependencies]
@@ -909,8 +905,7 @@ available and reevaluate your `rand` requirements according to the new version
909905
you have specified.
910906
-->
911907

912-
次回、`cargo build`コマンドを走らせたら、Cargoは利用可能なクレートのレジストリを更新し、
913-
`rand`クレートの必要条件を指定した新しいバージョンに従って再評価します。
908+
次に`cargo build`コマンドを実行したとき、Cargoは利用可能なクレートのレジストリを更新し、あなたが指定した新しいバージョンに従って`rand`の要件を再評価します。
914909

915910
<!--
916911
There’s a lot more to say about [Cargo][doccargo] and [its
@@ -1658,21 +1653,21 @@ discusses structs and method syntax, and Chapter 6 explains how enums work.
16581653
[parse]: ../std/primitive.str.html#method.parse
16591654
-->
16601655

1661-
[prelude]: ../std/prelude/index.html
1662-
[variables-and-mutability]: ch03-01-variables-and-mutability.html#variables-and-mutability
1656+
[prelude]: https://doc.rust-lang.org/stable/std/prelude/index.html
1657+
[variables-and-mutability]: ch03-01-variables-and-mutability.html#変数と可変性
16631658
[comments]: ch03-04-comments.html
1664-
[string]: ../std/string/struct.String.html
1665-
[iostdin]: ../std/io/struct.Stdin.html
1666-
[read_line]: ../std/io/struct.Stdin.html#method.read_line
1667-
[ioresult]: ../std/io/type.Result.html
1668-
[result]: ../std/result/enum.Result.html
1659+
[string]: https://doc.rust-lang.org/stable/std/string/struct.String.html
1660+
[iostdin]: https://doc.rust-lang.org/stable/std/io/struct.Stdin.html
1661+
[read_line]: https://doc.rust-lang.org/stable/std/io/struct.Stdin.html#method.read_line
1662+
[ioresult]: https://doc.rust-lang.org/stable/std/io/type.Result.html
1663+
[result]: https://doc.rust-lang.org/stable/std/result/enum.Result.html
16691664
[enums]: ch06-00-enums.html
1670-
[expect]: ../std/result/enum.Result.html#method.expect
1665+
[expect]: https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.expect
16711666
[recover]: ch09-02-recoverable-errors-with-result.html
16721667
[randcrate]: https://crates.io/crates/rand
16731668
[semver]: http://semver.org
16741669
[cratesio]: https://crates.io/
16751670
[doccargo]: http://doc.crates.io
16761671
[doccratesio]: http://doc.crates.io/crates-io.html
16771672
[match]: ch06-02-match.html
1678-
[parse]: ../std/primitive.str.html#method.parse
1673+
[parse]: https://doc.rust-lang.org/stable/std/primitive.str.html#method.parse

0 commit comments

Comments
 (0)