Navigation
index
next
|
previous
|
Intro to CS 2023
»
Lecture Notes, Week 05
¶
Strings
Resources
Strings, revisited
Exercise 01
Food for thought about Exercise 01.1
Mini-interlude about the food for thought about Exercise 01.1
Mini-interlude about the Emacs content of the food for thought about Exercise 01.1
Mini-interlude about Exercise 01.2
Mapping a character-to-character function pointwise over a string
Random interlude
Exercise 02
Small (but helpful) interlude about Exercise 02
Exercise 03
General interlude
Exercise 04
General interlude (continued)
Food for thought
General interlude (ended)
Aftermath
Exercise 05
Solution for Exercise 05
Exercise 06
Solution for Exercise 06
Exercise 07
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
Executive summary
Unparsing integers
Interlude about integers
Unparsing pairs of Booleans and strings
The situation so far
Exercise 05
Unparsing polymorphic pairs
Unparsing polymorphic triples
Interlude
Exercise 06
The end game: printing unparsed values
Resources
Version
Unit tests, re-revisited
Resources
Separating the “what” and the “how”
Testing the successor function
Resources
Version
Where do we go from here?
Food for thought
More 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
Local declaration of a recursive function
Exercise 07
Global declaration of a recursive function
Syntactic sugar for declaring recursive functions
A first example: doubling up a natural number
Food for thought
Simplifying the definition of the doubling function
Exercise 08
Solution for Exercise 08
Interlude
Exercise 09
Exercise 10
Solution for Exercise 10
Aftermath
Exercise 11
Exercise 12
The even predicate
The odd predicate
Exercise 13
After hours
Pablito’s dream
Resources
Version
Polynomials revisited
Exercise 14
Polynomials revisited, continued
Exercise 15
Polynomials revisited, continued^2
Exercise 16 (implementing the base case)
Polynomials revisited, continued^3
Exercise 17 (implementing the induction step)
Polynomials revisited, ended
Postlude
Exercise 18
Post-postlude
Post-post-postlude
Aftermath
Exercise 19
The rise and fall of Factorial numbers
Exercise 20
Resources
Version
Exercises for Week 05
Exercise 00
Mandatory exercises
Recommended exercise
Exercise 21
Resources
Version
Index of concepts for Week 05
Version
Previous topic
Index of concepts 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 2023
»