2  Advice & Logistics

Helper functions. Most of the functions you are asked to write will require helper functions, sometimes many helper functions. Think carefully about each function: is it structural or generative or a composition of helper functions? If structural, on which argument (or maybe multiple arguments)?; can you use map, filter, andmap, ormap, or one of the folds?

 

Tests. Test as you go, or you will be overwhelmed. Test cases play two roles. Before you write each function, they help you understand what will go into the function (and thus, help you figure if you need a helper function and what a helper function might do). After you write the function, they make sure that you wrote it properly. Be sure you exploit them in both ways.

 

Teachpack. The Sudoku teachpack is here: http://www.cs.uchicago.edu/~robby/courses/15100-2005-fall/fp/sudoku-tp.zip. Unzip the file and use the teachpack sudoku-tp.ss in version 209 and the teachpack sudoku-tp-299.ss in version 299. (The provides all of the exports of the image.ss, in addition to the operations described here. Do not use any other teachpacks.) If you use the wrong teachpack, you will get strange error messages.

 

Solution submission. Both sections should email solutions (the ``Intermediate Student with Lambda'' code, not .pdfs or word files, etc.) to robby@cs.uchicago.edu by the end of Dec 5th (i.e., midnight).

 

Performance. Do not read this paragraph until your solver is working. You may notice that your solver is not particularly fast. Partly, this is due to all of the extra checking that the teaching languages do. Once you are sure your program is working well and not before, you can change the language level to make it run faster. Beware, however, that this will make your program much harder to debug; it is so bad, in fact, that some programs that should signal errors will now just give bad output. You have been warned. To speed it up, follow these steps:

  1. Select the ``Choose Language...'' menu item in the ``Language'' menu.

  2. Choose the ``Pretty Big'' language level, under the ``PLT'' turndown triangle.

  3. Before closing the language dialog, click the ``Show Details'' button, which will make some more options visible.

  4. Click ``No debugging or profiling''.

  5. Remove the teachpack.

  6. Add a new first line to your program: (require "sudoku-tp.ss") after moving your solution file to the same folder as the Sudoku teachpack (do not move the teachpack out of the folder it was in; it needs all of the other files there).

Now your solver should run much more quickly.