CMPU10104 Computer Science I and Lab. (Fall 2018)
Calendar
This calendar will evolve over the course of the semester. Typical entries will include links to the code we have studied in class, details of lab. problems and assignments, and sections of the textbook we covered in class.
Please note that Tuesday, 11th December and Wednesday, 12th December have a Thursday and Friday schedule.
Wk.  Tuesday 
Thursday 
Friday 
I 
Welcome and Introduction. 
Setting up a Computer Science (CS) department account. Introduction to the drRacket program. Poking the computer & seeing what happens. 
Creating directories with mkdir . Moving between directories with cd . Listing files with
ls . Your first program in Scheme. Running, saving and loading a program.

II 
Poking the computer (a second time). Data types. Evaluation of symbols to their definitions. The importance of parentheses. First explorations of Scheme's computational model. 
Reviewing data types. Review of Scheme's computational model ('evaluate and apply'). The output of a function. The printf command and sideeffect printing. Line breaks and substituting into printed text.
What lambda does.


III 
Using predicates to answer yes/no questions. Arithmetic predicates. The multipurpose eq? function.
Shielding a datum from evaluation using the quote function, and its abbreviation. Beginning conditionals
and the if statement.

A brief review of if . Using cond for more complex situations, including the use of
else . Contracts, how to write them and why they are important.


IV 
Introducing recursion. Infinite loops and how to avoid them. The factorial function
(take 1).

Recursion, part 2: the Fibonacci sequence. 

V 
Return of conditionals. Introducing boolean operators and , or
and not , and their "truth tables".

Review of boolean operators and "truth tables". Review of predicates. Writing predicates without if or cond . Introducing nonempty lists. first and
rest .


VI 
Review of how if and cond can be interchanged with and and or . Constructing lists with cons .

MIDTERM REVIEW. Please bring questions & subjects to review. 
INCLASS MIDTERMCovers all material explored to date. 
Saturday, 13th to Sunday, 21st OctoberAUTUMN BREAKHappy holidays! :) 

VII 
Individual Reviews. 
The Default Rule, formally ('evaluate and apply'). Builtin functions vs. Special Forms; how special forms do not follow the Default Rule. The builtin eval function & how drRacket applies it at each step.

Introducing tail recursion and accumulators. The 'function box' as an analogy for drRacket's processing of code. Wrapper functions and writing contracts for them. 
VIII 
Brief review of accumulators and wrapper functions. Returning to lists and list recursion. Starting from a single, simple function and an idea. Adding small improvements to our code as our ideas change. 
List recursion continued. Passing a function as an input to a function. Mapping: applying the same function to every element in a list. Skipping items in lists. 

IX 
Nested lists. How to recursively explore nested lists.
Adding help for the player, and how it requires us to change 
Local environments. (And multicoloured candy apples.) The let special form: syntax and evaluation, and its
similarities to functions using lambda . The let* special form.


X 
Review of list operations with cons . Review of let and let* . Defining recursive local
functions with letrec* .
First look at the 
Destructive programming. Changing the values of variables with set! . The while function, which lets us
loop any number of times. The dotimes function, which loops a fixed number of times.


XI 
Review of loops using dotimes . Using the counting variable of an outer loop as input to the counting variable of an inner loop. The when special form. Comparing when against if and cond .

No class! Happy Thanksgiving!  
XII 
Organising data using structures. The definestruct special form, and the special forms it creates to help us use structures.

Storing data using vectors. Mutable and immutable vectors. Creating mutable vectors with makevector and immutable vectors with #(...) . vectorref and vectorset .


XIII 


INCLASS FINALFocuses on material since midterm,but covers all material. 
XIV 
Class 
Lab. 
No class! End of classes :'( 