From 18ce3878e5bddf566df873261d898c0ebdab050d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Katariina=20J=C3=A4rvenm=C3=A4ki?= Date: Sun, 29 Mar 2026 22:08:23 +0300 Subject: [PATCH] Add Tampiorama index page linking hello world, factorial, and fibonacci examples --- examples/basics/index.itp | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 examples/basics/index.itp diff --git a/examples/basics/index.itp b/examples/basics/index.itp new file mode 100644 index 0000000..1c05bab --- /dev/null +++ b/examples/basics/index.itp @@ -0,0 +1,40 @@ +# Tampiorama +# +# An index of annotated Tampio examples. +# This page is itself a Tampio program — the source on the left +# is what generates the links and descriptions on the right. +# +# "nykyinen sivu näyttää tekstin X" = document.write(X) + +# Hei maailma — Hello World +# +# The simplest Tampio program. +# Entry point: Kun nykyinen sivu avautuu = When the current page opens +# "näytetään käyttäjälle" triggers a browser alert. + +# Kertoma — Factorial +# +# Recursive factorial using the ternary: +# riippuen siitä ... joko ... tai +# = depending on whether ... either ... or +# Multiplication uses adessive case: kerrottuna kertomalla + +# Fibonacci-kani — Fibonacci +# +# Recursive Fibonacci named "kani" (rabbit), +# after Fibonacci's original rabbit problem from 1202. +# Addition uses illative case: lisättynä kaniin +# n-2 computed by chaining: edeltäjän edeltäjä + +Kun nykyinen sivu avautuu, + nykyinen sivu näyttää tekstin "

Tampiorama

", + nykyinen sivu näyttää tekstin "

Annotated examples for Tampio, a natural-language OOP language using Finnish grammar that compiles to JavaScript.

", + nykyinen sivu näyttää tekstin "

Hei maailma →

", + nykyinen sivu näyttää tekstin "

Hello world. Page-load entry point, browser alert.

", + nykyinen sivu näyttää tekstin "

Open the page — it will alert 'Hei maailma!' immediately.

", + nykyinen sivu näyttää tekstin "

Kertoma →

", + nykyinen sivu näyttää tekstin "

Recursive factorial. Ternary branching, adessive multiplication.

", + nykyinen sivu näyttää tekstin "

Open the page — enter a number when prompted, e.g. 5, and see 120.

", + nykyinen sivu näyttää tekstin "

Fibonacci-kani →

", + nykyinen sivu näyttää tekstin "

Recursive Fibonacci. Illative addition, predecessor chaining.

" +ja nykyinen sivu näyttää tekstin "

Open the page — enter a number when prompted, e.g. 10, and see 55.

".