Goals
- Stretch your problem solving skills in a programming environment.
- Write a Processing program from scratch.
Setup
Start with a new project in Processing. Your TA should pass around a sheet of paper so you can visually plan before you start programming.
Taijitu
Create a Taijitu in Processing similar to the one shown below.
Step 1: Planning
It is really important to think carefully about how you are going to attack a problem before you attempt to do anything. Many a programmer (or other problem solver) can waste a lot of time by taking a wrong approach or getting bogged down in the programming details.
Take a sheet of paper and sketch out the Taijitu. Then break it down into individual shapes along with their colors and sizes -- these will translate into Processing statements!
Step 2: Program the Taijitu
You are restricted to using at most one rectangle, but may use as many ellipses as you would like to.
Other useful commands (case-sensitive!):
size
,
smooth
,
background
,
stroke
,
noStroke
,
fill
,
noFill
,
strokeWeight
.
If you are unsure of what these commands do, you can check the Processing reference.
You may work in partners, but make sure that you fully understand your own solution.
Step 3: Make It Dynamic [OPTIONAL]
Make that symbol move!
You are welcome to do something similar to what we did with the robot or,
given the circular nature of the Taijitu, you might also consider playing around with the rotate()
and translate()
commands.
Submission
- If you worked with a partner on this lab, both of you should submit the same file, but make sure to include both of your names in the comments at the top of the file.
- Make sure that most of your lines of code have comments so that someone else can understand it.
- Submit your code (
.pde
file) to the Canvas assignments page for this lab.