Code: Learning programming with Jennifer
Learning programming with Jennifer: the code
Every program from the slides, one file per slide. They need no server, no decks and no setup beyond Jennifer 0.26.0, and run from this folder.
hello.j: "A program is a list of steps". Run:jennifer run hello.jvariables.j: "Variables are named boxes", printsAda is 37. Run:jennifer run variables.jsums.j: "Doing sums", prints 13, 3.5, 3 and 1. Run:jennifer run sums.jdecisions.j: "Making decisions", printspleasant; change the temperature to see the other answers. Run:jennifer run decisions.jquestions.j: the comparisons and the wordsand,or,notfrom "Questions with yes or no answers", with sample values. Run:jennifer run questions.jloops.j: "Doing it again: loops", the countdown and three rounds. Run:jennifer run loops.jlists.j: "Lists keep things in order". The slide shows the first line; the loop then prints the three fruits. Run:jennifer run lists.jmaps.j: "Maps look things up by name". Run:jennifer run maps.jfunctions.j: "Functions give a name to steps", prints13.50 square metres. Run:jennifer run functions.jmistakes.sh: "Mistakes become messages". Writestypo.jandcheck.jto a temporary directory and runs them, because programs with mistakes cannot be kept here (every.jfile in this folder must passjennifer lint). The path in each message is that temporary directory, not/home/ada. Run:sh mistakes.shreport.j: "Putting it together", prints Ada with an A and Alan with a B. Run:jennifer run report.jrepl.shwithrepl.txt: "Try things in the REPL". Pipes the four lines ofrepl.txtintojennifer repl; piped input is not echoed, so the answers follow the>>>prompts without the typed lines. Run:sh repl.sh
| File | Size | |
|---|---|---|
| LICENSE | 899 B | raw |
| README.md | 1.7 KiB | raw |
| decisions.j | 186 B | raw |
| functions.j | 172 B | raw |
| hello.j | 39 B | raw |
| lists.j | 207 B | raw |
| loops.j | 179 B | raw |
| maps.j | 166 B | raw |
| mistakes.sh | 606 B | raw |
| questions.j | 461 B | raw |
| repl.sh | 254 B | raw |
| repl.txt | 57 B | raw |
| report.j | 310 B | raw |
| sums.j | 118 B | raw |
| variables.j | 115 B | raw |