Fishing Minigame
Jump to navigation
Jump to search
| Designed by | Corbin |
|---|---|
| Appeared in | 2025 |
| Computational class | Polynomial |
| Reference implementation | [1] |
Fishing Minigame is a declarative language for describing idle games. It is an S-expression language which describes two sorts of objects: resources which evolve over time and actions which allow the user to interact with resources. It was originally introduced by Corbin[1] for Langjam Gamejam 2025[2] as an alternative to writing an imperative graphics-oriented language.
Syntax
Fishing Minigame is described by the following Raku grammar:
grammar Sexp {
token id { <[-a..zA..Z]>+ }
token s { '"' <-["]>+ '"' }
token n { <[0..9]>+ ('.' <[0..9]>+)? ('e' <[0..9]>+)? }
proto rule ratop {*}
rule ratop:sym<count> { '.count' }
rule ratop:sym<n> { <n> }
rule ratop:sym<div> { '(/' <ratop> <ratop> ')' }
proto rule boolop {*}
rule boolop:sym<lt> { '(<' <ratop> <ratop> ')' }
proto rule strop {*}
rule strop:sym<s> { <s> }
rule strop:sym<rat> { '(str' <ratop> ')' }
rule strop:sym<cond> { '(if' <boolop> <strop> <strop> ')' }
rule view { '(view' <id> <strop> ')' }
proto rule lineitem {*}
rule lineitem:sym<costs> { '(costs' <n> <id> ')' }
rule lineitem:sym<pays> { '(pays' <n> <id> ')' }
rule lineitem:sym<enhances> { '(enhances' <id> <id> <n> '->' <n> ')' }
rule lineitem:sym<enables> { '(enables' <id> <id> <id> ')' }
proto rule rate {*}
rule rate:sym<eats> { '(eats' <n> <id> '/s' ')' }
rule rate:sym<growth> { '(growth' <n> '/s' ')' }
rule rate:sym<converts> { '(converts' <n> <id> '->' <n> <id> '/s' ')' }
proto rule rmod {*}
rule rmod:sym<lineitem> { <lineitem> }
rule rmod:sym<rate> { <rate> }
rule rmod:sym<view> { <view> }
proto rule thing {*}
rule thing:sym<resource> { '(resource' <id> <n> <s> <rmod>* ')' }
rule thing:sym<action> { '(action' <id> <s> <lineitem>* ')' }
rule TOP { '(venture' <s> <thing>* ')' }
};
References
- ↑ C. Simpson, 2025. A day late and a fish short. https://raku-advent.blog/2025/12/23/day-23-a-day-late-and-a-fish-short/ https://gist.github.com/MostAwesomeDude/5db135a86f9f412eb337f636aecdd3eb
- ↑ A. Z. Henley, 2025. Langjam Gamejam. https://langjamgamejam.com/