===== CS 111 - Week 3 Lecture 2 - 2024-09-12 ===== ===== TODAY WE WILL: ===== * announcements * continuing intro to scene type * intro to the function big-bang * prep for next class ===== * should be working on Homework 2 * at-least-first-attempts due by 11:59 pm this Friday, September 13 * submit early, submit often! ===== a bit more about the scene type ===== * from module 2htdp/image * also provides two basic operations on scene type data, two functions: empty-scene place-image ;----- ; signature: empty-scene: number number -> scene ; purpose: expects a desired scene's width and height ; in pixels, and returns a blank scene of that ; width and height ;----- ; signature: place-image: image number number scene -> scene ; purpose: expects a desired image, a desired x and y location, ; and a desired scene, and returns a new scene with ; that image at that location in that scene * NOTE: in a BSL Racket scene (as in a number of graphics libraries), the coordinate system is based on old CRT (cathode ray tube) monitors (whose screens refreshed from left-to-right, top-to-bottom) * so, for these, it was convenient for larger x to be further right, and larger y to be further down: (0,0) 1 2 3 x -----|----|----|--> | | 1 - | | 2 - | | 3 - | y v * that's what place-image uses! * so when you call place-image with, say: (place-image (circle 5 "solid" "black") 20 70 (empty-scene 150 100)) ...you get a scene of little 10-pixel diameter black circle centered at 20 across, 70 down (in a scene of size 150 pixels wide, 100 pixels tall)