正在加载图片...
comments that document your work. Remember that your real-life flesh and bones tutor will be reading and grading your project. Commenting your code and otherwise explaining your work is an important part of your project submission--it is a good habit to get into now. For example PART 2 ;ii The following test cases explore the evaluation of simple expressions (*78) Value: 56 Note that later on you will be using the on-line tutor to submit small segments of code for evaluation by the tutor, as part of each weekly problem set. We strongly suggest that you still use Edwin to develop and test your code Once it is working to your satisfaction, the you can cut and paste the expressions into the tutor window for submission Part 3: Pretty printing As you begin to write more complicated code, being able to read it becomes very important. To start building good habits, type the following simple expression into Scheme(with interspersed Edwin commands as shown) (define abs C-3 (lambda (a)C-3(if(>a 0)C-1 a c-3(-a)))) Show a copy of how this actually appears in your buffer Do the same thing, but in place of each c-3, use the Enter key followed by the Tab key. What difference is there in the result? Part 4(Optional): Real printing If you want to print your a hardcopy of your work(at the end of this project), you will need commands to do this. These commands are issued from an interface to the operating system. If you logged in at the 6.001 Lab, an xterm window opened up. Inside that window, you can issue commands for printing. To see what the printer queue looks like, use lpq (this automatically selects the first available printer among those physically in the lab To print, assume that you have saved your work in - /u600 1/work/projectOl scm. Then go to xterm and type the following cd /u6001/work (to connect to this directory) (make sure the file you want is in fact therecomments that document your work. Remember that your real-life flesh and bones tutor will be reading and grading your project. Commenting your code and otherwise explaining your work is an important part of your project submission -- it is a good habit to get into NOW! For example: ;;; PART 2 ;;; ;;; The following test cases explore the evaluation of simple expressions. ;;; (* 7 8) ;Value: 56 Note that later on you will be using the on-line tutor to submit small segments of code for evaluation by the tutor, as part of each weekly problem set. We strongly suggest that you still use Edwin to develop and test your code. Once it is working to your satisfaction, then you can cut and paste the expressions into the tutor window for submission. Part 3: Pretty printing As you begin to write more complicated code, being able to read it becomes very important. To start building good habits, type the following simple expression into Scheme (with interspersed Edwin commands as shown): (define abs C-j (lambda (a) C-j (if (> a 0) C-j a C-j (- a)))) Show a copy of how this actually appears in your buffer. Do the same thing, but in place of each C-j, use the Enter key followed by the Tab key. What difference is there in the result? Part 4 (Optional): Real printing If you want to print your a hardcopy of your work (at the end of this project), you will need commands to do this. These commands are issued from an interface to the operating system. If you logged in at the 6.001 Lab, an xterm window opened up. Inside that window, you can issue commands for printing. To see what the printer queue looks like, use lpq (this automatically selects the first available printer among those physically in the lab). To print, assume that you have saved your work in ~/u6001/work/project0l.scm. Then go to xterm and type the following cd ~/u6001/work (to connect to this directory) ls (make sure the file you want is in fact there)
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有