1 / 6

GBK Programming 1

GBK Programming 1. Jordan Johnson. Today’s plan. Greeting Review Hand Tracing Finish Traffic Light Program Variant Data, continued: Itemizations Journal HW Clean-up. Warm-up.

hosea
Download Presentation

GBK Programming 1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. GBK Programming 1 Jordan Johnson

  2. Today’s plan Greeting Review Hand Tracing Finish Traffic Light Program Variant Data, continued: Itemizations Journal HW Clean-up

  3. Warm-up By hand, trace the evaluation of (sqrt (+ (sqrx) (sqr 5)))if x is defined as 10, sqrt is the square-root function, and sqr is defined by (define (sqrn) (* nn))

  4. Problem: • Develop a simulation of a traffic light. • Requirements: • Track the light’s current color. • Update the light in response to user input,using the usual progression: • green  yellow  red green • So far: • Defined the data • Created the key handler • Need the draw function & big-bang hookup

  5. More complex variant types ;; AKeyEventis either... ;; - a str1 ;; - “release” ;; - “up”, “down”, “left”, “right”, “home”, “end” ;; - “prior” or “next” (representing PageUp/PageDown) ;; - “f1”, “f2”, “f3”, ..., or “f24” ;; - “numpad1”, “numpad2”, ... “numpad0” ;; - ...(or any of a number of more obscure key names) ;; A str1 is a string containing one keyboard character, ;; which may be a special one like “\b” (backspace), ;; “\t” (tab) or “\n” (Enter) We can use higher-level definitions and refer to other definitions, too:

  6. Clean-up • Before you leave, please . . . • Log out. • Push in your chair. • Make sure you’ve got everything. • Make sure all trash ends up in the trash can.

More Related