go get github.com/kura-lab/bw
package main
import (
"time"
"github.com/kura-lab/bw"
)
func main() {
numbers := 220
bw := bw.NewBubbleWrap(numbers)
bw.Display()
for i := 0; i < numbers; i++ {
time.Sleep(20 * time.Millisecond)
bw.Pop(i)
bw.Redisplay()
// you can call when need to interrupt
// bw.Interrupt()
}
}
numbers := 220
// set numbers of a column
bw := NewBubbleWrap(numbers).SetColumn(60)
// change bubble's shapes
bw := NewBubbleWrap(numbers).ChangeBubbleShape("o", "x")
// change bubble's colors
before := color.New(color.FgCyan)
after := color.New(color.FgRed)
bw := NewBubbleWrap(numbers).ChangeBubbleColor(before, after)