Lab: Writing your own procedures

Assigned
Monday, 4 September 2023
Summary
We explore techniques for writing procedures in Scheme.

Syntax to remember

  • Defining names: (define <name> <expression>).
  • Function expressions: (lambda (<parameters>) <expression>).
  • Defining functions: (define <name> (lambda (<parameters>) <expression>))

The lab

As in the previous lab (and future labs), you will work with a randomly assigned partner using a starter file.

Remember to employ good pair programming practices as discussed in the previous lab!

  • One person, the driver, is in control of keyboard. They focus on the immediate task of designing and coding a solution, speaking aloud about their design thoughts as they work.
  • The other person, the navigator, acts as a reviewer. They observe and think more about strategic architectural issues. They look for potential issues and raise them with the driver. They are also responsible for keeping track of the time spent on the problem.

Work

All of the instructions are in the file. Switch to that now.

Acknowledgements

The checkerboard example comes from a very old version of CSC 151. We are no longer sure which member or members of the department wrote it.

Bits and parts of this lab come from procedure labs from other versions of CSC 151.