Introductory bits. Working out what six times nine is. Sometimes the simplest things are the hardest to do. The compilation cycle. | ||||||
Why computers use binary instead of decimal. Modern programming languages are maniacally picky, but for good reason. Important for Mac owners. Operators and values. | ||||||
Solving quadratic equations: step 1: Simplest possible approach just to get started step 2: That used square root of a negative, this uses numbers that allow a solution step 3: Named constants have many benefits step 4: A conditional avoids the square root of negatives step 5: This also notices when there is only one solution step 6: User interaction is more flexible and useful step 7: Two simple new functions make a nice improvement Listing the numbers between 0 and 10: first incomplete version, and the correct version. | ||||||
A brief guest presentation. Stack frames/activation records - little boxes of memory where functions remember their details. Plotting a graph. | ||||||
Storage media (a slight aside). Important graphics functions and some words about lab 2. Programs should not use the words while, do, or for until further notice. Programs should not use the word goto ever. A closer examination of recursion and some more compelling examples: Graph plotter, first mystery, half of it, separating the digits of a number. | ||||||
Good design example: define one constant (width) and make others be a proportion of that. More recursive divide-and-conquer design: Printing numbers in words, just the digits, Introducing arrays to make that more compact, Plotting a graph that needs scaling, Spirographs, Calculating and listing powers of two. | ||||||
Good design: make function leave things exactly as they were when possible. Plotting a 3D graph, the z axis is represented by colour: z = sin(hypot(x, y)) * sin(pow(hypot(x - 5, y - 5), 0.8)), range -10 to 10. An absurdly long program, and the tiniest beginnings of an improvement. | ||||||
The complete number speaker, very important to understand the recursion. (A little aside about capitalising the first letter). First look at an important example function, be sure you understand it. | ||||||
Day off | 14th | |||||
Break | 25th to 30th | |||||
Lab 1, | Mon 25th Aug - Thur 28th Aug. | |||||
(Lab 1 pdf) | Using visual C++ to run programs; drawing stars and stick figures. | |||||
Lab 2, | Tue 2nd Sep - Mon 8th Sep. | |||||
(Lab 2 pdf) | Divide and conquer: building big programs from little functions. | |||||
Lab 3, | Tue 9th Sep - Mon 15th Sep. | |||||
(Lab 3 pdf) | Controlling repetition in programs. |
Lab 4, | Tue 17th Sep - Mon 23rd Sep. | |||||
(Lab 4 pdf) | A video game: blowing things up with a cannon. | |||||
Lab 5, | Tue 24th Sep - Mon 30th Sep. | |||||
(Lab 5 pdf) | A real-time animated clock application. | |||||
Lab 6, | Tue 1st Oct - Mon 7th Oct. | |||||
(Lab 6 pdf) | Generating calendars and using Unix. | |||||
Lab 7, | Not happening this semester due to last week's closure. | |||||
(Lab 7 pdf) | A happy street scene. | |||||
Lab 8, | Wed 16th Oct - Tue 22nd Oct. | |||||
(Lab 8 pdf) | An interactive desk calculator. | |||||
Lab 9, | Wed 23rd Oct - Tue 29th Oct | |||||
(Lab 9 pdf) | An interactive map, the data files: outlines and capitals. | |||||
Lab 10, | Wed 30 Oct - Tue 5 Nov | |||||
(Lab 10 pdf) | Database programming under Unix. The special timing function. | |||||
Lab 11, | Wed 6 Nov - Tue 12 Nov | |||||
(Lab 11 pdf) | A robot searching for treasure in a maze.
sample maze;
alternate sample. | |||||
Lab 12, | Wed 13 Nov - Tue 19 Nov | |||||
(Lab 12 pdf) | An automatic robot: he turned into a video game. |