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

Outputting the generated numbers in "Generating random numbers for games and similar apps" #51

Closed
MAS-OUD opened this issue Mar 25, 2023 · 1 comment

Comments

@MAS-OUD
Copy link
Contributor

MAS-OUD commented Mar 25, 2023

on page 358, the code doesn't output anything. I suggest the code writes the generated random numbers to the console:

...
WriteLine($"dieRoll = {dieRoll}");

...
WriteLine($"randomReal = {randomReal}");

...
for (int i = 0; i < arrayOfBytes.Length; i++)
{
    WriteLine($"arrayOfBytes[{i}] = {arrayOfBytes[i]}");
}
@markjprice
Copy link
Owner

markjprice commented Mar 25, 2023

The code shown is supposed to be read, not entered, because the generated results are random so there's no point showing the output in the book because it will never look like what the reader sees. You only need to enter code when instructed to do so by numbered steps. Of course, readers are welcome to write any code they like and output anything they like.

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

No branches or pull requests

2 participants