Академический Документы
Профессиональный Документы
Культура Документы
Introduction
Real (and fun) applications
Physics simulations Videogames ... No factorials!
Agenda
Chapter Application 1 Bouncing ball Constructs Control flow, tuples, functions
2
3 4
Rocket Saturn V
Asteroid field Bigger asteroid field
Chapter 1
Basic Data Manipulation
Preliminar notes
Indentation is part of the code
Spaces matter!
Not allowed
if i > 10 then "hello" else 20
Generic functions
Parameters of (almost) any type
a = any type
let y1 = quadratic ((fun (x,y) -> x+y),(fun (x,y) -> x*y), 10,4,-2,3) let y2 = quadratic ((fun (x,y) -> x+y),(fun (x,y) -> x*y), 10.0,4.0,-2.0,3.0)