Navigation
index
next
|
previous
|
Intro to CS 2021
»
Lecture Notes, Week 05
¶
Strings
Resources
Strings, revisited
Exercise 1
Food for thought about Exercise 1.1
Mini-interlude about Exercise 1.2
Mapping a character-to-character function pointwise over a string
Random interlude
Exercise 2
Small (but helpful) interlude about Exercise 2
Exercise 3
General interlude
Exercise 4
General interlude (continued)
Food for thought
General interlude (ended)
Aftermath
Conversion between integers and strings
Formatting strings
Formatted output
Resources
Version
Unparsing values and formatting strings
Resources
Unparsing values
Unparsing Booleans
Interlude about Booleans
Unparsing characters
Interlude about characters
Unparsing strings, or from the frying pan into the fire
Interlude about strings
Interlude about strings within strings
Unparsing integers
Interlude about integers
Unparsing pairs of Booleans and strings
Exercise 5
Unparsing polymorphic pairs
Unparsing polymorphic triples
Interlude
Exercise 6
The end game: printing unparsed values
Resources
Version
Where do we go from here?
Food for thought
Version
Tracing function calls and returns
Resources
The point
Versions where the calls are traced
Versions where the calls and the returns are traced
Traced versions with an indentation that reflects the nesting of the calls
Resources
Version
The factorial function
Resources
The mandatory unit-test function
Mathematical specification of factorial numbers
How to compute a factorial number, with a little help from our friends
La même chose, with a little help from OCaml
Resources
Version
Induction and recursion over natural numbers
Resources
From inductive data to structurally recursive functions
A first example: doubling up a natural number
Food for thought
Simplifying the definition of the doubling function
Exercise 7
Solution for Exercise 7
Interlude
Exercise 8
Solution for Exercise 8
Aftermath
Exercise 9
The even predicate
The odd predicate
Exercise 10
Declaring a global recursive function
After hours
Vigfus’s dream
Resources
Version
Exercises for Week 05
Exercise 0
Mandatory exercises
Recommended exercises
Exercise 11
Resources
Version
Previous topic
Exercises for Week 04
Next topic
Strings
Quick search
Enter search terms or a module, class or function name.
Navigation
index
next
|
previous
|
Intro to CS 2021
»