For

Looping constructs in Racket.

All of these are Google Docs.

Intermediate Student Mode

You can access the “for” command inside Intermediate Student Mode by using (require racket/base).

Place that require after any define-struct.

(require picturing-programs)
(define-struct model (score x y))
(require racket/base)

If you require racket/base before doing define-struct, a struct like (make-model 500 8 15) will print out as (model ...) instead of showing the contents!

Additional For Exercises


For 0.5

Reviewing and reteaching for/list commands. Good intro exercises.

For 1.5

Two variables in a for loop, short practice.

For 1.4

Review of basic for concepts, introduction to for/fold.