Files
Programming-Game-AI-by-Exam…/chapter-2-state-driven-agent-design/cmd/westworld/main.go
T

23 lines
539 B
Go

// Command westworld runs a tiny demo of the finite state machine
// built in the westworld package: it creates one miner and lets him
// tick forward on his own, watching his state machine drive him
// around the loop (sleep -> dig -> bank/saloon -> sleep, ...).
package main
import (
"fmt"
"git.jjstudio.me/jonas/Programming-Game-AI-by-Example-Go/chapter-2-state-driven-agent-design/westworld"
)
func main() {
bob := westworld.NewMiner(1)
const numUpdateSteps = 30
for range numUpdateSteps {
bob.Update()
}
fmt.Println()
}