Code Monkey home page Code Monkey logo

gobonsai's Introduction

gobonsai

A bonsai tree generator (cbonsai ported to go)

screenshot


Usage:
  gobonsai [flags]

Examples:
  gobonsai -p --seed 42
  gobonsai -l -L 48 -M 3
  gobonsai --msg "hi" --msg-y 20
  gobonsai -S -c "&,@,§,$,%,☘️,🌿,🍎,💚,🟢,🟩"

Flags:
  -l, --live             live mode: show each step of growth
  -t, --time duration    in live mode, delay between steps of growth (default 33ms)
  -i, --infinite         infinite mode: keep growing trees
  -w, --wait duration    in infinite mode, delay between each tree (default 4s)
  -S, --screensaver      screensaver mode: equivalent to -li and quit on any keypress
  -b, --base int         base pot: big=1 small=2 (default 1)
      --base-x int       column position of upper-left corner of plant base pot
      --base-y int       row position of upper-left corner of plant base pot
  -a, --align int        align tree: center=1 left=2 right=3 (default 1)
  -m, --msg string       attach message next to the tree
      --msg-x int        column position of upper-left corner of message text (default 4)
      --msg-y int        row position of upper-left corner of message text (default 2)
  -c, --leaves string    list of comma-delimited leaves (default "&")
  -M, --multiplier int   branch multiplier higher -> more branching (0-20) (default 5)
  -L, --life int         life higher -> more growth (0-127) (default 32)
  -p, --print            print first tree to stdout and exit immediately
  -s, --seed int         seed random number generator (default random)
  -h, --help             show help

gobonsai is a go port of
cbonsai (written in C and itself a port of
bonsai.sh (written in bash and itself a port of
bonsai (written in javascript))).

gobonsai's People

Contributors

dependabot[bot] avatar nothub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

gobonsai's Issues

Refactor pots

gobonsai/pot.go

Lines 7 to 12 in af75dcb

// TODO: generalize the pot func and use type for sizes struct
type Pot func(sc *screen) error
var bigPot = func(sc *screen) error {
pw, ph := 31, 4
px, py := potPos(sc, pw, ph)


This issue was generated by todo-issue based on a TODO comment in af75dcb.

sort flags

gobonsai/options.go

Lines 33 to 38 in af75dcb

// TODO: sort flags
var o opts
pflag.BoolVarP(&o.live, "live", "l", false, "live mode: show each step of growth")
pflag.DurationVarP(&o.time, "time", "t", 33*time.Millisecond, "in live mode, wait TIME between steps of growth")
pflag.BoolVarP(&o.infinite, "infinite", "i", false, "infinite mode: keep growing trees")


This issue was generated by todo-issue based on a TODO comment in af75dcb.

check supported number of colors

TODO: color schemes? (8-col, original cbonsai, monochrome)


gobonsai/colors.go

Lines 18 to 23 in af75dcb

// TODO: check supported number of colors
// TODO: color schemes? (8-col, original cbonsai, monochrome)
// based on type of tree, determine what color a branch should be
func chooseColor(kind branch) tcell.Style {
switch kind {


This issue was generated by todo-issue based on a TODO comment in af75dcb.

make -a be a shortcut for setting relative values for -y

bx, --baseX=INT Col pos of upper-left corner of plant base


gobonsai/options.go

Lines 60 to 65 in af75dcb

TODO: make -a be a shortcut for setting relative values for -y
-bx, --baseX=INT Col pos of upper-left corner of plant base
-by, --baseY=INT Row pos of upper-left corner of plant base
*/
pflag.StringVarP(&o.message, "message", "m", "", "attach message next to the tree")
alignRaw := pflag.IntP("align", "a", int(center), "align tree: center=0 left=1 right=2")


This issue was generated by todo-issue based on a TODO comment in af75dcb.

draw message

m, --message=STR Attach message next to the tree


gobonsai/main.go

Lines 57 to 62 in af75dcb

// TODO: draw message
// -m, --message=STR Attach message next to the tree
// refresh screen
evDrawn(sc)


This issue was generated by todo-issue based on a TODO comment in af75dcb.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.