Assignments should be done using DrRacket (version 7.8), a free instructional development environment tailored for use with the CS 135 textbook. We recommend you download DrRacket and use it on your own computer. DrRacket is available for free for Unix (including Linux), Mac OS X, and Windows.
For more information, see Assignment 0.
There are a variety of ways to turn your Racket program’s file into a “non-plaintext file” – a format
that our marking software cannot handle. If you submit an assignment and receive a warning about it,
save your file by going to DrRacket:
File→Save Other→Save Definitions1 as Text.
What actions make your file “non-plaintext”? Copy/paste operations from the interactions window or the assignment PDF may do it, depending on the characters included. Inserting Comment Boxes in DrRacket can also do it.
Example warning:
Racket has libraries to trace function calls. This can be very helpful when troubleshooting problems. By default these libraries do not work in Beginning Student or Beginning Student with List Abbreviations… until now.
If you would like to trace function calls in your programs, download the following library: cs135-trace.rkt.
For a quick video illustrating the use of this library, see the Tracing Quickstart video.
For a more in-depth explanation of integrating tracing into program development, see the Tracing Guide video.
To use the library, download it into the folder that contains your Racket files. Then at the top of your Racket file enter the following line:
(require "cs135-trace.rkt")
Now, to trace a function, change the define
in the function definition to
define/trace
. For example,
;; (count lst) produces the number of elements in lst
(define (count lst)
(cond
[(empty? lst) 0]
[else (+ 1 (count (rest lst)))]))
becomes
;; (count lst) produces the number of elements in lst
(define/trace (count lst)
(cond
[(empty? lst) 0]
[else (+ 1 (count (rest lst)))]))
After doing this, calls to count
will be traced in the Interactions
Window.
Important: Before submitting your code to MarkUs, change any
define/trace
invocations back to define
.
There is also a “Save Interactions as Text” that you do not want. ↩︎