Skip to content
Snippets Groups Projects
Verified Commit 0a7422de authored by Tóth Miklós Tibor's avatar Tóth Miklós Tibor :shrug:
Browse files

Add Pac-man

parent 3a76ea46
No related branches found
No related tags found
No related merge requests found
package main
import (
"pp/pkg/tutter"
"time"
)
func main() {
lineLen := 20
pos := 0
dir := true
for {
line := ""
for i := 0; i < lineLen; i++ {
if i == pos {
if dir {
line += "🌜"
} else {
line += "🌛"
}
} else {
line += "🍎"
}
}
e := tutter.Send(line)
if e != nil {
panic(e)
}
time.Sleep(time.Second / 2)
if dir {
pos++
} else {
pos--
}
if pos >= lineLen-1 {
dir = false
}
if pos <= 0 {
dir = true
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment