refactor out a pattern for adding other commands
added dance, shrug.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package main
|
||||
|
||||
import "mcquay.me/yay"
|
||||
|
||||
type Dance struct {
|
||||
yay.Sequence
|
||||
}
|
||||
|
||||
func NewDance() *Dance {
|
||||
d := &Dance{
|
||||
yay.Sequence{
|
||||
Frames: [][]rune{
|
||||
[]rune(`<('o'<) `),
|
||||
[]rune(` ('-') `),
|
||||
[]rune(` (>'o')>`),
|
||||
[]rune(` ('-') `),
|
||||
[]rune(` ('-') `),
|
||||
[]rune(` ('-') `),
|
||||
[]rune(` (>'o')>`),
|
||||
},
|
||||
},
|
||||
}
|
||||
return d
|
||||
}
|
||||
|
||||
func main() {
|
||||
t := yay.NewViewPort(NewDance())
|
||||
t.Run()
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package main
|
||||
|
||||
import "mcquay.me/yay"
|
||||
|
||||
type Shrug struct {
|
||||
yay.Sequence
|
||||
}
|
||||
|
||||
func NewShrug() *Shrug {
|
||||
return &Shrug{
|
||||
yay.Sequence{
|
||||
Frames: [][]rune{
|
||||
[]rune(`¯\_(ツ )_/¯`),
|
||||
[]rune(`¯\_(ツ )_/¯`),
|
||||
[]rune(`¯\_(ツ )_/¯`),
|
||||
[]rune(`¯\-(ツ )-/¯`),
|
||||
[]rune(`¯\_(ツ )_/¯`),
|
||||
[]rune(`¯\-(ツ )-/¯`),
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
t := yay.NewViewPort(NewShrug())
|
||||
t.Run()
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package main
|
||||
|
||||
import "mcquay.me/yay"
|
||||
|
||||
type Yay struct {
|
||||
yay.Sequence
|
||||
}
|
||||
|
||||
func NewYay() *Yay {
|
||||
y := &Yay{
|
||||
yay.Sequence{
|
||||
Frames: [][]rune{
|
||||
[]rune(`.o.`),
|
||||
[]rune(`.o.`),
|
||||
[]rune(`.o.`),
|
||||
[]rune(`.o.`),
|
||||
[]rune(`.o.`),
|
||||
[]rune(`.o.`),
|
||||
[]rune(`-o-`),
|
||||
[]rune(`\o/`),
|
||||
[]rune(`\o/`),
|
||||
[]rune(`\o/`),
|
||||
[]rune(`-o-`),
|
||||
},
|
||||
},
|
||||
}
|
||||
return y
|
||||
}
|
||||
|
||||
func main() {
|
||||
t := yay.NewViewPort(NewYay())
|
||||
t.Run()
|
||||
}
|
||||
Reference in New Issue
Block a user