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

Exercise Solutions #55

Open
shiffman opened this issue Aug 5, 2022 · 6 comments
Open

Exercise Solutions #55

shiffman opened this issue Aug 5, 2022 · 6 comments
Assignees

Comments

@shiffman
Copy link
Member

shiffman commented Aug 5, 2022

The first edition of the book came with some exercise solutions (not all). Picking up on the conversation from #54, I'm filing an issue (for later) to develop a way to either include exercise solutions in the book text itself or separate repo.

@shiffman
Copy link
Member Author

It's time for me to finally get organized about the exercise solutions. @jasongao97 could we build a page identical to https://natureofcode.com/examples/ for this? As well as possible include a link to exercise solutions (when one exists) on the page itself? When I create one I can add a link to the p5 web editor sketch in Notion (similar to what we do with the examples.)

@shiffman
Copy link
Member Author

We could start with this one! https://natureofcode.com/random/#exercise-010

@shiffman shiffman removed the future label Sep 24, 2024
@shiffman
Copy link
Member Author

For exercise solutions that are already in the book, we can leave them as is and add them to the new exercise "index" page. For any new exercise solutions that get added after the fact, we'll mark them with a special emoji so that they are skipped in the PDF build. I lean towards including them on the website for now.

Screenshot 2024-09-24 at 9 32 37 AM

Maybe we use the previous "web only" emoji system?

@sidwellr
Copy link

sidwellr commented Oct 3, 2024

The exercise solutions page will not be identical to the examples page. Unlike the examples, not all exercises are code (or even code snippets). For example Exercise 0.2 is two probability questions; clicking on it should go to a page with a short explanation of the answers (not just "0.59% and 0.45%").

More importantly, most exercises have multiple solutions. Especially open-ended ones like Exercise 0.4 (a paint splatter simulation), but even simple ones like Exercise 0.1 (walker with tendency to move down and right), with a note "The solution follows in the next section" has solutions besides the one in Example 0.3 (A walker that tends to move to the right). My solution to Exercise 0.10 (noise-based landscape) is quite different from the one in the book (https://editor.p5js.org/rsidwell/sketches/moPaJyM23 if you are interested).

So a couple of things to consider when designing the exercise solutions page:

  1. Should the solutions include explanatory text to help understand the solution? Or just the solutions themselves?
  2. Should the website contain multiple solutions to the exercises? Or just show one way to do it?
  3. Some readers who are having trouble with an exercise may appreciate a hint to help them figure it out rather than just seeing a solution. (But that's a whole lot of work!)
  4. How should readers contribute their own solutions to exercises (as the book invites them to)?

@shiffman
Copy link
Member Author

shiffman commented Oct 8, 2024

These are great points! I hadn't considered this so thoroughly. I think, for now, I will focus on p5.js sketches that are "answers" to solutions. If you follow this discussion into #1025 you'll see the proposed language of "suggested answer", which I think covers the idea of "one suggested solution."

For readers to contribute, they can open an issue with their solution and I would manually add it. We could also create a markdown page in this github repo for additional "community" solutions if there is enough interest.

@sidwellr
Copy link

sidwellr commented Oct 8, 2024

Another place for readers to share "community" solutions is the Passenger Showcase on the Coding Train website. The last paragraph of the Introduction also invites sharing there. There is just one problem: Passenger Showcase must be tied to a video, and not all NoC videos have been created yet. Perhaps you could find some time to create short introduction videos for each chapter to provide an anchor for reader contributions.

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

4 participants