all repos

scratch @ efe3f18614c0e2e1994d738b5e9bd127df509d6d

⭐ me doing recreational ~~drugs~~ programming

scratch/brainfuck/README.md (view raw)

1
# gbf
2
3
I was bored and made this :star: gleaming brainfuck interpreter.
4
5
## How to use?
6
### As library
7
```gleam
8
import gbf
9
import gleam/io
10
11
pub fn main() -> Nil {
12
  let input =
13
    "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++."
14
15
  let assert Ok(virtual_machine) = gbf.run(input)
16
17
  virtual_machine
18
  |> gbf.output
19
  |> io.println
20
//>  Hello World!
21
}
22
```
23
24
### As CLI tool
25
```bash
26
gleam run -m gbf/run ./examples/helloworld.bf
27
#> Hello World!
28
```