CS3505 Lecture5
CS3505 Lecture5
Lecture 5:
Dynamic Arrays
Const
Lecture Quizzes
• I added another dropped score
– Make these last ones more of a practice
• The goal is to encourage timely review of
lecture material
A2
• Three main chunks of code
– HaruPDF
• setup a page/close a page
• place a character at a position/orientation on page
– Spiral
• Move along a spiral in character-sized jumps
– Project
• get text
• loop over text
– get spiral position
– print on pdf
A2 Visually
Not
Spiral HaruPDF HaruPDF
Spiral
Project Project
• Keep modular
• Haru class does haru tasks
#justharuthings HaruPDF
• Spiral class does spiral actions
Project
• main talks to each to do the
task Spiral
A2: Spiral
• You need to adapt the circle
math so the spiral goes
radius * sin(θ)
clockwise from “12 o’clock”.
– First, understand the circle math
radius
• A spiral has an increasing
radius
– Adapt the math in the example radius * cos(θ)
code (centerX, centerY)
– There is a center point, a radius,
and angle that produces a point
on the circle.
– What does it mean to have the
letters stay close as the spiral
grows?
• What are some “gotchas” with
the spiral math?
Code Style
• We are sometimes
going to discuss code
• Sometimes some of
your code
• This is a common
activity in software
development
• It should not be done in
a mean way
– Think of constructive
changes
– But you also have to be
willing to learn from it
Using a Static Library
• That is all!
Using a Static Library