How to design programs/Problem set 1
Jump to navigation
Jump to search
- Install DrScheme. http://www.drscheme.org/
- Install TortoiseSVN or an appropriate SVN client for your platform.
- Check out svn://thebluealliance.net/svnroot/scheme into a local folder. Contact GregMarra for privs.
- Commit a file to your user folder. You do not have write permission to /.
- Read the Wikipedia article on Polish Notation.
- http://en.wikipedia.org/wiki/Polish_notation
- Evaluate the following expressions:
i. (+ 1 2) ii. (- 5 3) iii. (* 2 2) iv. (* (+ (- 5 2) 2) 1) v. (exp 2 (+ 2 1))
- Prefix Notation is the way that Scheme works. EVERYTHING is (operator parameter parameter).
- Complete hw1 Scheme exercises.
- The file is in the repository. You will be able to read it once you have checked it out.
- I’d recommend making separate files for each problem (2.2.1.scm, 2.2.2.scm). Some are modifications of earlier programs, just do a save as.
- This took me about 4-6 hours to complete. I’d expect it takes you a similar amount. Break it into three or so two hour chunks. Talk someone else into going through it with you if you can. Pair programming (use VNC!) is awesome.
Notes[edit | edit source]
1. Read the preface; at least through xxiii; skim remainder of preface. 2. I highly recommend keeping a "Programming Journal" or, if you prefer, "Lab Notebook", where you write in the following: a. Code that causes a syntax error. If you encounter a syntax error, and can't immediately see why it is, print it out, and put it in the notebook. When you find the solution, note it in the notebook as well. This provides a reference for errors you've encountered, and reinforces the error/solution pair for later. (Recognizing errors quickly is valuable in the long run.) b. Code that surprised you. You did something, and it worked, and you're not sure why. c. Code that works well. In particular, code that you wrote that you were confident about the process, and have some notes that you want to abstract from later. Eg. "By breaking out function 'urgh', I was able to solve this other problem more easily..." 3. Work the following exercises as you're reading through the text. (Or, read the text, then go back and do the exercises.) Section 2 -- 2.1.1: consider making use of the "Help Desk". It contains, literally, thousands of pages of documentation. It is your friend, by-and-large. 2.1.2 2.2.1 - figure out how to use TeachPack part 2.2.2 2.2.3 2.2.4 2.2.5 2.3.1 2.3.2 2.3.3 (These are good candidates for the lab notebook) 2.4.1 2.4.2 2.4.3 2.4.4 Section 2.5 is where the design recipe really comes in. Read carefully, take notes, create a "cheat sheet", if you like. (I had one on my wall for a while. What does yours look like?) 3.1.1 3.1.2 3.1.3 3.1.4 This is a powerful, yet simple, idea in computing: giving names to values. 3.2.1 asks you to do just that. If you're not convinced of what you're supposed to do or why, you should ask for help. 3.2.1 These should have a full recipe followed: 3.3.2 3.3.3 The "stepper" is a powerful debugger. We'll use/discuss/reflect on this tool more. 3.3.6 is the first time you're explicitly asked to use it, I believe. 3.3.6 Work through all the bits in sections 4 and 5. Stop at section 6. The concepts and ideas change a bit. So, the last questions are (from me) are reflective in nature: What syntaxes in Scheme have you encountered so far? What types of data have you seen? What kinds of programs can you write? Are they interesting? Why or why not?" 5) Commit your completed hw1 exercises to the repository in the /''yourname''/ folder. 6) I will send you your next assignment over the weekend of June 14th. 7) E-mail Matt Jadud and thank him for developing the curriculum I am shamelessly ripping.