Original Post
I'm teaching Caml Light programming to a CS 101 class. Next week, I'll be covering 2D graphics, and the students get their hands on the computers so I would like to give out some exercises which are both interesting and non-trivial. I expect that it won't take more than 15 minutes for them to tackle the "draw a circle, draw a line, draw a polygon, draw a pixel, draw a bezier curve" part of the subject using the provided library functions. The graphics library is the default Caml Light one. It can handle animations pretty well, but that takes some time to teach unless I restrict myself to low framerates. It handles pixel-putting, 24-bit colors, lines, polygons (filled or unfilled), ellipses, rectangles and text. So, here are a few other ideas I've had, and I'd be glad if you guys had any other suggestions.
- (Last year) Sierpinsky triangle.
- (Last year) color gradients.
- (Last year) naive convex hull algorithm.
- (Last year) naive triangulation algorithm.
- (Last year) destructible worms-style terrain.
- (Last year) 2D waves.
- Wolfram's rule 30
- Game of life
- Tetris
- Billiards simulation
- Maze generator
- Function graph plotter
- Tiling the plane