Skip to content

tnantoka/dbngo

Repository files navigation

dbngo

A tiny Design By Numbers clone written in Go.
Generate PNG adn GIF from .dbn files.

Example

// gradient.dbn

Repeat A 0 100 {
  Pen A
  Set Y (100 - A)
  Line 0 Y 100 Y
}
$ dbngo -i gradient.dbn -p gradient.png -g gradient.gif -s 2

Live demo with wasm

https://dbngo.tnantoka.com/

Commands

  • Paper
  • Pen
  • Line
  • Set
  • Set (Dot)
  • Set (Copy)
  • Repeat
  • Same/Notsame
  • Smaller/Notsmaller
  • Command
  • Load
  • Number
  • Mouse
  • Forever
  • Key
  • Net
  • Time
  • Array

Built-in libraries

  • Letters

Diffs

Command DBN dbngo
Load Load lib.dbn Load "lib.dbn"

Examples

  • amoebic
  • bandedclock
  • calculate
  • commands
  • dancinguy
  • dancingy
  • dots
  • grainsofrain
  • graymachine
  • headsortails
  • intersecting
  • line
  • looping
  • meeber
  • merging
  • nervousguy
  • nesting1
  • nesting2
  • painting
  • paper
  • paramecium
  • plaid
  • probing
  • quantitative
  • questions
  • raininglines
  • reactive
  • repeating
  • rocket2
  • rockettime
  • thehunt
  • time1
  • time2
  • tuftball
  • variable
  • mitpress/*

Development

$ go install golang.org/x/tools/cmd/goyacc@latest

$ goyacc -o parser/parser.go parser/parser.go.y

$ go fmt ./...

$ go test $(go list ./... | grep -v /wasm) -coverprofile=cover_broken.out && \
  cat cover_broken.out | grep -v yaccpar | grep -v .y > cover.out && \
  go tool cover -html=cover.out -o coverage.html

$ go run main.go -i testdata/hello.dbn -p tmp/dbngo.png -g tmp/dbngo.gif -s 2

Acknowledgements

Author

tnantoka