nature-of-code / Nature-of-Code-Website-Archive

Repo for web files for nature of code
https://noc-processing-archive.netlify.app/
111 stars 21 forks source link

Wrong code on Introduction: Traditional random walk example #40

Closed PatrizioG closed 1 year ago

PatrizioG commented 2 years ago

Hi, in the example I.1: Traditional random walk, the step method with floats it's wrong:

float stepx = random(-1, 1); float stepy = random(-1, 1);

I think that the correct code is

float stepx = random(-1, 2); float stepy = random(-1, 2);

shiffman commented 1 year ago

These examples have changed and are being updated in https://github.com/nature-of-code/book-website-2nd-edition!