EECS 111 Lecture Notes - Lecture 1: Fahrenheit

32 views3 pages

Document Summary

To define a function, instead of equal, we use define . In bsl, (define (f x) (* x (+ x 1))) Once this is done you can compute, by writing (f 2) or (f (+ 1 3)) Ex: define a function that squares (define (square x)(* x x)) Function to check if two strings are equal is (string=?) Function to stick strings together is (string-append) (string-append apple or pear ) = apple or pear . This will return an image of a 35 x 25 pixel solid black rectangle (circle 25 outline white ) This will return an image of an outlined white circle with a radius of 25. You combine numbers with +, strings with string-append, and images with overlay (overlay (rectangle 35 25 solid black ) (circle 25 outline white )) So if you wrote (define my-circ (circle 25 outline white ))

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents