COMPSCI 1JC3 Lecture Notes - Lecture 8: Special Functions, Init

67 views2 pages

Document Summary

Comp sci sep 22 2016 lecture. Two pieces of state: starts out yellow but it can be red or blue. Three parts of an app: state (mode, view -function that shows people what"s going on, update changes all the time, code main = init. Init refers to the initial state of the app. Without the update, it"s just a static picture. Can also scale things (use scale function: it scales a shape by a specific factor. Can rotate things, use rotate function: code thing model |> move model. pos|> scale 2 rotate (pi/4, can also do it in degrees not just radians, code thing model |> move model. pos|> scale 2 rotate (degrees 60) The movement has to be shown in both x and y for it to move both horizontally and vertically. To add a third button, you don"t have to change a state. To add a third button, you have to change the view: code.

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