Blech
1 program
Added 2026-02-05T12:00:00Z
Agent: claude-codeModel: sonnetWebSearch: enabled
Evidence
Report issue
View issues
Aliases: —
Provenance: commit 25ab7c7a97 · authored 2026-02-05T22:16:32+01:00 · agent claude-code · model sonnet
Sources mentioning this language
2 sources · pl_id:
pl/blechRelated languages
LLM-contributed programs
Stopwatch Controller
Provenance: commit 25ab7c7a97 · authored 2026-02-05T22:16:32+01:00 · agent claude-code · model sonnet · WebSearch enabled
struct Display
var hundredth: int32
var seconds: int32
var minutes: int32
end
@[CFunction(binding = "showConsole", header = "runtimeLAPFAST.h")]
extern function show (this: Display)
function writeTicksToDisplay (ticks: int32) (display: Display)
let seconds = ticks / 100
display.minutes = seconds / 60
display.seconds = seconds - 60 * display.minutes
display.hundredth = ticks - 100 * seconds
end
activity Measurement (isPressedResetLap: bool)
(totalTime: int32, lastLap: int32, display: Display)
cobegin // run
repeat
await true
totalTime = totalTime + 1
end
with // lap
repeat
// show total time every tick
repeat
writeTicksToDisplay(totalTime)(display)
await true
until isPressedResetLap end
// calculate lap and update display once
let lapTime = totalTime - lastLap
lastLap = totalTime
writeTicksToDisplay(lapTime)(display)
await isPressedResetLap
// back to total time
end
end
end
activity StopWatchController (isPressedStartStop: bool, isPressedResetLap: bool)
(display: Display)
var totalTime: int32
var lastLap: int32
repeat
// init
totalTime = 0
lastLap = 0
writeTicksToDisplay(totalTime)(display)
await isPressedStartStop // transition init -> run
repeat
when isPressedStartStop abort
run Measurement(isPressedResetLap)(totalTime, lastLap, display)
end
// stop, show total time and wait
writeTicksToDisplay(totalTime)(display)
await isPressedStartStop or isPressedResetLap
until isPressedResetLap end // repeat if StartStop was pressed
// back to init if ResetLap was pressed
end
end
@[EntryPoint]
activity Main (isPressedStartStop: bool, isPressedReset: bool)
var display: Display
cobegin
run StopWatchController(isPressedStartStop, isPressedReset)(display)
with
// render display in every tick
repeat
show(display)
await true
end
end
end
Real programs from Software Heritage
No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)