Description
Programming Paradigms |
Lab 2. Recursion on lists |
Outline
- ● Lists recap
- ● Exercise: plotting data series
- ● Exercise: Conway’s Game of Life
Warm-up exercise: plot data series as a histogram
Exercise 2.1.
Implement function plot-bars that renders a histogram given a list of values.
Conway’s Game of Life
- Render universe (represented as a function)
- Render one cell
- Render one row
- Render 2D universe
- Implement stepping function
- Find all neighbours of a cell
- Count alive neighbours
- Implement stepping function
- Verify your implementation
Conway’s Game of Life: Example
Conway’s Game of Life: Example
Homework
- Read SICP 1.2 Procedures and the Processes They Generate
- Solve exercises 1.11, 1.14, 1.16, 1.26 from SICP
- Implement function in Racket that renders a Koch snowflake of given rank: