Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

book: remove "input" assignment in first guessing_game example #25163

Closed
wants to merge 2 commits into from

Conversation

jonboiser
Copy link

The original code snippet results in a confusing program where something like this happens:

Please input your guess.
5
You guessed: 3

For reasons I don't understand, I think the pattern is "You guessed: length of input + 2".

A later code sample with the random number generator at lines 459-463 leaves out that assignment to input, and that code works as expected.

The original code snippet results in a confusing program where something like this happen:

```
Please input your guess.
5
You guessed: 3
```

A later code sample at the section "Processing a guess" (line 75) leaves out that assignment to `input`, and that code worked as expected.
@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @steveklabnik (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see CONTRIBUTING.md for more information.

@jonboiser jonboiser changed the title book: remove "input" assignment in first example book: remove "input" assignment in first guessing_game example May 7, 2015
@jonboiser
Copy link
Author

I think this is related to #25148, but the code changes are different. Edit: this PR combines the code changes with #25147 #25154 . Closing.

@jonboiser jonboiser closed this May 7, 2015
@jonboiser jonboiser deleted the patch-1 branch May 11, 2015 21:14
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.

3 participants