示例#1
0
文件: basic.go 项目: glenn-brown/aima
func main() {
	world := p11.NewWorld(20)
	agent := agent.New()
	window, err := vu.NewWindow(vu.Flat(vu.Frame(world)))
	if err != nil {
		panic(err)
	}
	for {
		world.Step(agent)
		window.Render()
		time.Sleep(300 * time.Second)
	}
}
示例#2
0
文件: many.go 项目: glenn-brown/vu
func main() {

	// Create nested views.

	dflt := vu.Frame(voronoi.New())
	frame := vu.Frame(vu.Landscape(dflt))
	vbox := vu.Vbox(dflt, vu.Stack(frame, vu.Cube(vu.Spin(vu.NewScatter(points())))))
	wiggle := vu.Wiggle(vu.Frame(vu.Hbox(vu.Portrait(dflt), vbox)))
	w, err := vu.NewWindow(wiggle)
	if err != nil {
		panic("NewWindow failed")
	}

	// Render them until the window is closed.

	for {
		w.Render()
	}
}