Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thimc/fungus
befunge-93 interpreter written in go
https://github.com/thimc/fungus
befunge-93 esolang go golang interpreter
Last synced: about 1 month ago
JSON representation
befunge-93 interpreter written in go
- Host: GitHub
- URL: https://github.com/thimc/fungus
- Owner: thimc
- License: mit
- Created: 2024-05-14T18:56:17.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-05-14T19:05:28.000Z (8 months ago)
- Last Synced: 2024-05-15T15:20:06.537Z (7 months ago)
- Topics: befunge-93, esolang, go, golang, interpreter
- Language: Go
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fungus
fungus is a [Befunge-93](https://en.wikipedia.org/wiki/Befunge)
interpreter written in go. Befunge is a two-dimensional stack-based,
reflective, esoteric programming language.| Instruction | Description |
|------------|-------------|
| 0-9 | Push this number onto the stack. |
| + | Addition: Pop a and b, then push a+b |
| - | Subtraction: Pop a and b, then push b-a |
| * | Multiplication: Pop a and b, then push a*b |
| / | Integer division: Pop a and b, then push b/a, rounded towards 0. |
| % | Modulo: Pop a and b, then push the remainder of the integer division of b/a. |
| ! | Logical NOT: Pop a value. If the value is zero, push 1; otherwise, push zero. |
| ` | Greater than: Pop a and b, then push 1 if b>a, otherwise zero. |
| > | Start moving right |
| < | Start moving left |
| ^ | Start moving up |
| v | Start moving down |
| ? | Start moving in a random cardinal direction |
| _ | Pop a value; move right if value=0, left otherwise |
| \| | Pop a value; move down if value=0, up otherwise |
| " | Start string mode: push each character's ASCII value all the way up to the next " |
| : | Duplicate value on top of the stack |
| \ | Swap two values on top of the stack |
| $ | Pop value from the stack and discard it |
| . | Pop value and output as an integer followed by a space |
| , | Pop value and output as ASCII character |
| # | Bridge: Skip next cell |
| p | A "put" call (a way to store a value for later use). Pop y, x, and v, then change the character at (x,y) in the program to the character with ASCII value v |
| g | A "get" call (a way to retrieve data in storage). Pop y and x, then push ASCII value of the character at that position in the program |
| & | Ask user for a number and push it |
| ~ | Ask user for a character and push its ASCII value |
| @ | End program |
| (space) | No-op. Does nothing |## Building
go build -o fungus .
## Usage
./fungus
_NOTE: fungus will read from standard input if no arguments are passed_
## License
MIT