In addition to simple operations like append racket includes functions that iterate over the elements of a list these iteration functions play a role similar to for in java racket and other languages.
Floor function in racket.
The step from simulations to interactive programs is relatively small.
Roughly speaking a simulation designates one function create image as a handler for one kind of event.
A pair combines exactly two values.
The results of the last then body which is in tail position with respect to the cond form are the results for the whole cond form.
If only a else then body is present then the then body s are evaluated.
The first value is accessed with the car procedure and the second value is accessed with the cdr procedure.
Pairs are not mutable but see mutable pairs and lists.
If no cond clause s are present the result is void.
Scheme provides a set of functions for rounding a real number up down or to the nearest integer.
The full grammar for planet requires is given in importing and exporting.
The results from all but the last then body are ignored.
In each case the number is provided by the given pseudo random number generator which defaults to the current one as produced by current pseudo random generator.
The body of a racket iteration is packaged into a function to be applied to each element so the lambda form becomes particularly handy in combination with.
A keyboard event is triggered when a computer user presses a key.
In mathematics the result of the modulo operation is an equivalence class and any member of the class may be chosen as representative.
Defining functions applying functions functions that produce numbers and images.
Clock ticks in addition to clock ticks world programs can also deal with two other kinds of events.
A list is recursively defined.
Other useful maths functions rounding modulo gcd etc rounding functions.
4 10 pairs and lists.
Pairs and lists in the racket guide introduces pairs and lists.
It is either the constant null or it is a pair whose second value is a list.
Keyboard events and mouse events.
Variants of the definition.
Floor x this returns the largest integer that is no larger than x.
However other conventions are possible.
When called with two integer arguments min and max returns a random exact integer in the range min to max 1.
The remaining subsections list those functions that are built into the programming language.
Require and provide but the best place to find examples of the syntax is on the the planet server in the description of a specific package.
Ceiling x this returns the smallest integer that is no smaller than x.
When called with zero arguments returns a random inexact number between 0 and 1 exclusive.