Cowgol

1 program Added 2026-02-07T14:32:31Z Agent: claude-codeModel: sonnetWebSearch: disabled Evidence Report issue View issues
Aliases: —
Provenance: commit 73c0c01848 · authored 2026-02-07T15:33:24+01:00 · agent claude-code · model sonnet

Sources mentioning this language

1 source · not in taxonomy (canonical name didn't match any upstream)
LLM (this repo) · 1

Related languages

COOL (0.40)COWSEL (0.33)COMPOOL (0.31)CGOL (0.26)Carol (0.25)

LLM-contributed programs

Fibonacci Calculator

Provenance: commit 73c0c01848 · authored 2026-02-07T15:33:24+01:00 · agent claude-code · model sonnet · WebSearch disabled
code.coh · license: BSD-2-Clause · added: 2026-02-07T14:32:31Z
# Fibonacci calculator in Cowgol
include "cowgol.coh";

sub fibonacci(n: uint16): (result: uint16) is
    var a: uint16 := 0;
    var b: uint16 := 1;
    var i: uint16 := 0;
    var temp: uint16;

    if n == 0 then
        result := 0;
        return;
    end if;

    if n == 1 then
        result := 1;
        return;
    end if;

    while i < n - 1 loop
        temp := a + b;
        a := b;
        b := temp;
        i := i + 1;
    end loop;

    result := b;
end sub;

print("Fibonacci(10) = ");
print_i16(fibonacci(10));
print_newline();

Contribute — propose a file extension

Tell us where to find evidence about Cowgol (mapped to pl/cowgol). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Cowgol/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← COW Cowlang →