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+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents