From c4db98928e79197251c425acd9df605dfe2d0657 Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Mon, 26 Oct 2026 12:08:02 -0500 Subject: [PATCH] Publish calc-tester-60d8065f/calculator from Allen Allen item 0fc57c8a88dd56f7b589 Main 4f405e1093b923d8252cead889c4669b7e0c3cdf --- .../calc-tester-60d8065f/calculator/README.md | 10 ++++++++ .../calc-tester-60d8065f/calculator/calc.om | 16 +++++++++++++ .../calculator/index.html | 23 +++++++++++++++++++ .../calc-tester-60d8065f/calculator/meta.json | 15 ++++++++++++ 4 files changed, 64 insertions(+) create mode 100644 projects/calc-tester-60d8065f/calculator/README.md create mode 100644 projects/calc-tester-60d8065f/calculator/calc.om create mode 100644 projects/calc-tester-60d8065f/calculator/index.html create mode 100644 projects/calc-tester-60d8065f/calculator/meta.json diff --git a/projects/calc-tester-60d8065f/calculator/README.md b/projects/calc-tester-60d8065f/calculator/README.md new file mode 100644 index 0000000..c7dc812 --- /dev/null +++ b/projects/calc-tester-60d8065f/calculator/README.md @@ -0,0 +1,10 @@ +# Calculator + +A four-function calculator for whole numbers. The arithmetic is written in Omega (`calc.om`), +compiled to WebAssembly by Allen's Omega compiler, and run by `index.html` in the browser with +nothing loaded from elsewhere. + +Who it helps: anyone who wants a tiny, readable example of an Omega program running on a web +page, and students checking quick sums. Division by zero returns 0. + +Built with Allen at https://www.aienos.com/allen/ (end-to-end test of the build loop). diff --git a/projects/calc-tester-60d8065f/calculator/calc.om b/projects/calc-tester-60d8065f/calculator/calc.om new file mode 100644 index 0000000..efd2fe0 --- /dev/null +++ b/projects/calc-tester-60d8065f/calculator/calc.om @@ -0,0 +1,16 @@ +fn plus a long b long to long +ret add a b +end +fn minus a long b long to long +ret sub a b +end +fn times a long b long to long +ret mul a b +end +fn quot a long b long to long +q = long 0 +if ne b 0 +q = div a b +end +ret q +end diff --git a/projects/calc-tester-60d8065f/calculator/index.html b/projects/calc-tester-60d8065f/calculator/index.html new file mode 100644 index 0000000..f3c892a --- /dev/null +++ b/projects/calc-tester-60d8065f/calculator/index.html @@ -0,0 +1,23 @@ + + +Calculator + +

Calculator

+

Whole numbers, computed by Omega compiled to WebAssembly.

+

+

+ + diff --git a/projects/calc-tester-60d8065f/calculator/meta.json b/projects/calc-tester-60d8065f/calculator/meta.json new file mode 100644 index 0000000..a8722e8 --- /dev/null +++ b/projects/calc-tester-60d8065f/calculator/meta.json @@ -0,0 +1,15 @@ +{ + "built_with": "Allen", + "description": "A four-function calculator: Omega arithmetic compiled to WebAssembly.", + "files": [ + "README.md", + "calc.om", + "index.html" + ], + "handle": "calc-tester-60d8065f", + "item": "0fc57c8a88dd56f7b589", + "project": "calculator", + "saved": "2026-10-26", + "title": "Calculator", + "v": 1 +}