Testdrive

This page tours the Quarto features that matter for the course site. Everything here is one .qmd file: markdown, YAML header, and fenced blocks.

Math, straight from LaTeX

Inline math works as you’d hope (\(e^{i\pi} + 1 = 0\)), and so do display equations:

\[ x(t) = \frac{8}{\pi^2} \sum_{k=0}^{\infty} \frac{(-1)^k}{(2k+1)^2} \sin\bigl(2\pi (2k+1) f_0 t\bigr) \]

Callouts

OpmerkingTer herinnering

Python’s % geeft altijd een niet-negatief resultaat bij een positieve modulus: -2 % 26 == 24. Dat is anders dan in Java!

WaarschuwingVeelgemaakte fout

freqs crasht op een tekst zonder kleine letters — deling door nul.

Collapsible solutions

The pattern for exercises — the solution stays hidden until clicked:

Opgave. Wat is het resultaat van rotate(2, [1, 2, 3, 4, 5])?

[3, 4, 5, 1, 2]xs[2:] geeft [3, 4, 5], xs[:2] geeft [1, 2], en + plakt ze aaneen.

Tabsets

Schuif elke letter drie plaatsen op in het alfabet en spring terug naar het begin als je voorbij de z valt.

def shift(n, c):
    if c.islower():
        return int2let((let2int(c) + n) % 26)
    else:
        return c
>>> shift(3, 'z')
'c'
>>> shift(-3, 'a')
'x'

Diagrams

flowchart LR
  A[geheime tekst] --> B[freqs]
  B --> C[chisqr voor elke rotatie]
  C --> D[kleinste waarde = shift]
  D --> E[decodeer]

Every code block above has a copy button, the navbar has a dark-mode toggle, and the page reflows on a 1366×768 Chromebook screen. The Caesar page shows the part PDF can’t do: executed code.