Skip to content

Commit

Permalink
Merge pull request #121 from plaindocs/green
Browse files Browse the repository at this point in the history
Minor edits
  • Loading branch information
jonathanpallant authored Sep 30, 2024
2 parents 9bf7077 + f0173dc commit cc1ccca
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions exercise-book/src/green-yellow-game.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Green and Yellow Game

In this assignment we will implement the game "Green and Yellow". It’s like Wordle, but with numerical digits instead of letters. But for legal reasons it’s also entirely unlike Wordle, nor remotely similar to the 1970’s board-game "Mastermind".
In this assignment we will implement the game "Green and Yellow". It’s like Wordle, but with numerical digits instead of letters. But for legal reasons it’s also entirely unlike Wordle, and entirely unlike the 1970’s board-game "Mastermind".

## After completing this exercise you are able to
## After completing this exercise you will be able to

- Work with rust slices and vectors
- Accept input from stdin
Expand All @@ -11,7 +11,7 @@ In this assignment we will implement the game "Green and Yellow". It’s like Wo

## Prerequisites

For completing this exercise you need to have:
To complete this exercise you need to have:

- basic Rust programming skills
- the Rust Syntax Cheat Sheet
Expand Down Expand Up @@ -129,11 +129,11 @@ You need to grab a standard input handle with `std::io::stdin()`. This implement

### Parsing Strings into Integers

Strings have a `parse()` method, which returns a `Result`, because of course the user may not have typed in a proper digit. The `parse()` function works out what you are trying to create based on context - so if you want a `u8`, try `let x: u8 = my_str.parse().unwrap()`. Or you can say `let x = my_str.parse::<u8>().unwrap()`. Of course, try and do something better than unwrap!
Strings have a `parse()` method, which returns a `Result`, because of course the user may not have typed in a proper digit. The `parse()` function works out what you are trying to create based on context - so if you want a `u8`, try `let x: u8 = my_str.parse().unwrap()`. Or you can say `let x = my_str.parse::<u8>().unwrap()`. Of course, try to do something better than unwrap!

## Step-by-Step-Solution

In general, we also recommend to use the Rust documentation to figure out things you are missing to familiarize yourself with it. If you ever feel completely stuck or that you haven’t understood something, please hail the trainers quickly.
We also recommend using the official Rust documentation to figure out unfamiliar concepts. If you ever feel completely stuck, or if you haven’t understood something specific, please hail the trainers quickly.

### Step 1: New Project

Expand All @@ -144,7 +144,7 @@ Create a new binary Cargo project, check the build and see if it runs.

```shell
cargo new green-yellow
cd fizzbuzz
cd green-yellow
cargo run
```

Expand Down

0 comments on commit cc1ccca

Please sign in to comment.