@@ -25,7 +25,7 @@ program will indicate whether the guess is too low or too high. If the guess is
25
25
correct, the game will print a congratulatory message and exit.
26
26
-->
27
27
28
- 古典的な初心者向けのプログラミング問題を実装してみましょう: 数当てゲームです。
28
+ 古典的な初心者向けのプログラミング問題を実装してみましょう: 数当てゲームです。
29
29
これは以下のように動作します: プログラムは1から100までの乱数整数を生成します。
30
30
そしてプレーヤーに予想を入力するよう促します。予想を入力したら、プログラムは、
31
31
その予想が小さすぎたか大きすぎたかを出力します。予想が当たっていれば、ゲームは祝福メッセージを表示し、
@@ -219,7 +219,7 @@ features, including the ability to accept user input.
219
219
もし、使用したい型がpreludeにない場合は、` use ` 文で明示的にその型をスコープに導入する必要があります。
220
220
` std::io ` ライブラリを使用することで、ユーザ入力を受け付ける能力などの実用的な機能の多くを使用することができます。
221
221
222
- [ prelude ] : ../.. /std/prelude/index.html
222
+ [ prelude ] : https://doc.rust-lang.org /std/prelude/index.html
223
223
224
224
<!--
225
225
As you saw in Chapter 1, the `main` function is the entry point into the
@@ -332,7 +332,7 @@ library that is a growable, UTF-8 encoded bit of text.
332
332
[ ` String ` ] [ string ] <!-- ignore --> 型は、標準ライブラリによって提供される文字列型で、
333
333
サイズ可変、UTF-8エンコードされたテキスト破片になります。
334
334
335
- [ string ] : ../.. /std/string/struct.String.html
335
+ [ string ] : https://doc.rust-lang.org /std/string/struct.String.html
336
336
337
337
<!--
338
338
The `::` syntax in the `::new` line indicates that `new` is an *associated
@@ -387,7 +387,7 @@ type that represents a handle to the standard input for your terminal.
387
387
この` stdin ` 関数は、 [ ` std::io::Stdin ` ] [ iostdin ] <!-- ignore --> オブジェクトを返し、この型は、
388
388
ターミナルの標準入力へのハンドルを表す型になります。
389
389
390
- [ iostdin ] : ../.. /std/io/struct.Stdin.html
390
+ [ iostdin ] : https://doc.rust-lang.org /std/io/struct.Stdin.html
391
391
392
392
<!--
393
393
The next part of the code, `.read_line(&mut guess)`, calls the
@@ -399,7 +399,7 @@ guess`.
399
399
その次のコード片、` .read_line(&mut guess) ` は、標準入力ハンドルの[ ` read_line ` ] [ read_line ] <!-- ignore -->
400
400
メソッドを呼び出して、ユーザから入力を受け付けます。また、` read_line ` メソッドに対して、` &mut guess ` という引数を一つ渡していますね。
401
401
402
- [ read_line ] : ../.. /std/io/struct.Stdin.html#method.read_line
402
+ [ read_line ] : https://doc.rust-lang.org /std/io/struct.Stdin.html#method.read_line
403
403
404
404
<!--
405
405
The job of `read_line` is to take whatever the user types into standard input
@@ -485,8 +485,8 @@ well as specific versions for submodules, such as `io::Result`.
485
485
標準ライブラリにたくさんあります: 汎用の[ ` Result ` ] [ result ] <!-- ignore --> の他、
486
486
` io::Result ` などのサブモジュール用に特化したものまで。
487
487
488
- [ ioresult ] : ../.. /std/io/type.Result.html
489
- [ result ] : ../.. /std/result/enum.Result.html
488
+ [ ioresult ] : https://doc.rust-lang.org /std/io/type.Result.html
489
+ [ result ] : https://doc.rust-lang.org /std/result/enum.Result.html
490
490
491
491
<!--
492
492
The `Result` types are [*enumerations*][enums], often referred
@@ -535,7 +535,7 @@ entered into standard input.
535
535
返り値を取り出して、ただその値を返すので、これを使用することができるでしょう。
536
536
今回の場合、その返り値とは、ユーザが標準入力に入力したデータのバイト数になります。
537
537
538
- [ expect ] : ../.. /std/result/enum.Result.html#method.expect
538
+ [ expect ] : https://doc.rust-lang.org /std/result/enum.Result.html#method.expect
539
539
540
540
<!--
541
541
If you don’t call `expect`, the program will compile, but we’ll get a warning:
@@ -745,7 +745,7 @@ $ cargo build
745
745
Compiling libc v0.2.14 (libc v0.2.14をコンパイルしています)
746
746
Compiling rand v0.3.14 (rand v0.3.14をコンパイルしています)
747
747
Compiling guessing_game v0.1.0 (file:///projects/guessing_game) (guessing_game v0.1.0をコンパイルしています)
748
- Finished dev [unoptimized + debuginfo] target(s) in 2.53 secs
748
+ Finished dev [unoptimized + debuginfo] target(s) in 2.53 secs
749
749
```
750
750
751
751
<!--
@@ -1180,7 +1180,7 @@ in `guess` and `secret_number`.
1180
1180
それから、一番下に新しく5行追加して` Ordering ` 型を使用しています。` cmp ` メソッドは、
1181
1181
2値を比較し、比較できるものに対してなら何に対しても呼び出せます。このメソッドは、
1182
1182
比較したいものへの参照を取ります: ここでは、` guess ` 変数と` secret_number ` 変数を比較しています。
1183
- それからこのメソッドは` use ` 文でスコープに導入した` Ordering ` 列挙型の値を返します。
1183
+ それからこのメソッドは` use ` 文でスコープに導入した` Ordering ` 列挙型の値を返します。
1184
1184
[ ` match ` ] [ match ] <!-- ignore --> 式を使用して、` guess ` 変数と` secret_number ` を` cmp ` に渡して返ってきた` Ordering ` の列挙子に基づき、
1185
1185
次の動作を決定しています。
1186
1186
@@ -1380,7 +1380,7 @@ Rustには、組み込みの数値型がいくつかあります; ここの`u32`
1380
1380
` secret_number ` 変数も` u32 ` 型であるとコンパイラが推論することを意味します。
1381
1381
従って、今では比較が同じ型の2つの値で行われることになるわけです!
1382
1382
1383
- [ parse ] : ../.. /std/primitive.str.html#method.parse
1383
+ [ parse ] : https://doc.rust-lang.org /std/primitive.str.html#method.parse
1384
1384
1385
1385
<!--
1386
1386
The call to `parse` could easily cause an error. If, for example, the string
0 commit comments