uni

Thing1's amazing uni repo
Log | Files | Refs

commit 512fde0eda956fe169fbd50f8d2d1802fc2996e8
parent b929e8b424b9b63ba014961f45ac793c65b38be9
Author: thing1 <l.standen@posteo.com>
Date:   Fri, 31 Oct 2025 17:15:56 +0000

switched to pandoc

Diffstat:
MCS12020/03.10.25.md | 6++++--
MCS12020/06.10.25.md | 52++++++++++++++++++++++++++++++++--------------------
Mbuild | 7++++++-
Dteaching/a.out | 0
Dteaching/test | 0
Dteaching/test.c | 6------
6 files changed, 42 insertions(+), 29 deletions(-)

diff --git a/CS12020/03.10.25.md b/CS12020/03.10.25.md @@ -3,11 +3,12 @@ Serial ------ -- The arduino's serial port is on pins 0 and 1, when connected over usb, these ports don't work +- The arduino's serial port is on pins 0 and 1, when connected over usb, these ports don't work - Serial operations with the arduino's Serial class + ``` -begin( long baudrate ) // starts serial at that baudrate +begin(long baudrate) // starts serial at that baudrate println( (int | String | float) obj ) // prints an obj with a newline print( (int | String | float) obj ) // prints an obj parseInt() // reads an int @@ -15,5 +16,6 @@ parseInt() // reads an int Floats ------ + - `float` and `double` are the same size on the arduino diff --git a/CS12020/06.10.25.md b/CS12020/06.10.25.md @@ -4,24 +4,30 @@ Compound operators ------------------ - x += 3 - x *= 3 - x -= 3 - x /= 3 +``` +x += 3 +x *= 3 +x -= 3 +x /= 3 +``` Post increment -------------- - x++ - x-- +``` +x++ +x-- +``` When you say `y = x++` y is equ to x and x is equ to x + 1 Pre increment ------------- - --x - ++x +``` +--x +++x +``` When you say `y = ++x` y is equ to x + 1 and x is equ to x + 1 @@ -29,19 +35,22 @@ Branching --------- Standard conditional - if (x) { - f(); - } - else if (y) { - g(x); - } - else { - h(x); - } +``` +if (x) { + f(); +} +else if (y) { + g(x); +} +else { + h(x); +} +``` Switch statement - switch (x) { +``` +switch (x) { case 1: f(x); break; @@ -51,11 +60,14 @@ Switch statement default: h(x); break; - } +} +``` Ternary operator - val = (x) ? f(x) : g(x); +``` +val = (x) ? f(x) : g(x); +``` Comments -------- diff --git a/build b/build @@ -6,8 +6,13 @@ names=$(find ./ | grep "\.md") for name in $names; do out=$(echo $name | sed -e "s/\.md$//") - smu $name > $out.html || exit 1 + pandoc -o $out.html $name || exit 1 echo "compiled ${out}" done +dirs=$(ls -d */) +for dir in $dirs; do + cat $dir/*.html > $dir/book.html +done + echo "done!" diff --git a/teaching/a.out b/teaching/a.out diff --git a/teaching/test b/teaching/test Binary files differ. diff --git a/teaching/test.c b/teaching/test.c @@ -1,6 +0,0 @@ -#include "stdio.h" - -int main() { - printf("hello world\n"); - return 0; -}