Ejemplo n.º 1
0
// Run executes Step repeatedly, until Step returns an error, at which point this
// method will invoke o.Die and return.
func (c *Cpu) Run(o *org.Organism) error {
	Logger.Printf("%v.Run(%v)\n", c, o)
	for {
		if err := c.Step(o); err != nil {
			Logger.Printf("%v.Run: %v\n", c, err)
			o.Die()
			return err
		}
	}
}