Skip to content

Week 10: Recursion

Bryan Ma edited this page Apr 29, 2019 · 12 revisions

"In order to understand recursion, you must first understand recursion." (programmer humor)

Topics:

  • Factorials (with loops vs. recursion)
  • Cantor set, Koch curve
  • Representing nature with fractals
  • Recursive tree drawing
  • Fractals in 3D

Reading:

To go deeper with fractals, check out Chapter 8 of The Nature of Code - https://natureofcode.com/book/chapter-8-fractals/

Examples:

In-class examples plus an object-oriented version of the recursive tree are up here: https://github.com/whoisbma/Code_2_SP19/tree/master/Week_10

Final Project grading criteria:

  • The project should be creative, robust, and express some intent or core idea on your part. The code should have a strong relationship to the core idea. I will help you through 1 on 1 meetings in the next few weeks to establish an ideal level of project complexity.
  • The final should demonstrate the effective usage of several of the important concepts taught in class. "Effective usage" means not just plugging these concepts into your code arbitrarily. It means that for example if your sketch uses external data, external data is somehow useful or necessary for your project concept, architecture, interaction, behavior, etc. The concepts from class include:
    • Object-oriented programming
    • External data
    • State management
    • Web APIs
    • Physical simulation
    • 3D graphics
    • Recursion
  • Overuse of example code is generally a sign of low effort. Projects that use example code should first of all be documented as such ("I used the example from xyz") but just as importantly, should demonstrate a significant effort in modifying what was found to suit your own creative/design goals.
  • Effective uses of external libraries, APIs, or other resources is a plus. Projects that are out of the box implementations of some external library functionality is not good. For example, a project that uses the Kinect library to do some drawing with the skeletal data and not using it creatively.
  • Grading is partially based on week by week submissions, not just the overall final result on the last day of class.
  • Late submissions will lose a letter grade per day. Not presenting on the final class is more serious, unless you have set something up with me beforehand.
  • P5.js is fine.
  • Group projects are not allowed.

Effort always shows - put in the effort and look for opportunities to pivot if you are stuck. If you are stuck on a technical issue, don't just stop on it. Pivot to something that works and expand on it, or ask for help. I've gotten people presenting their finals saying: "I tried and I couldn't figure it out, so nothing works." Do not be one of those people - this is bad. Try hard, ask for help, look for opportunities to pivot.

Final Project precedents:

Many of you were interested in pursuing audio synthesis/visualization, data visualization, and games. These are all excellent topics to pursue.

Code:

This week I just want to see two sketches:

  • An experiment with drawing recursive forms. This can be based on the work we did in class. Try the challenges in the Recursion chapter of The Nature of Code.
  • A sketch showing some iteration on your final project idea. This could be a number of things:
    • A working proof of concept of a single feature of your project. For example, if you're doing a game with levels supplied from external data, you could have a prototype sketch with some sample data in JSON being captured in Level objects in your code. Maybe the Level class doesn't do or display anything yet, but you will have gotten data import working. That's a valid feature. Or, perhaps your final involves sound synthesis in some way, but you're not sure how yet. A feature proof of concept would involve getting some basic sound synthesis working with the Minim library.
    • If you're still completely stuck on concept, I need you to find some example project, game, art work, or some other precedent that you're interested in or find inspiring. Once you pick a precedent, you need to write a prototype to mimic some aspect of that precedent. For example, let's say your precedent was Minecraft - you find the world generation aspect of Minecraft interesting, and you think you might want to do something that resembles it in some way. A suitable prototype would be something like getting 3D noise generation work to place boxes around in 3D space.

Submit both sketches via git and canvas as usual.

Clone this wiki locally