This repository has been archived on 2021-01-15. You can view files and clone it, but cannot push or open issues or pull requests.
goBug/element.go

14 lines
250 B
Go
Raw Normal View History

2017-05-26 11:14:18 +00:00
package main
import "fmt"
2017-05-26 11:56:06 +00:00
type Element struct { //struttura che contiene sia cibo sia amebe
2017-05-26 11:14:18 +00:00
IsFood bool
Health int
Age int
}
func (e Element) String() string {
2017-05-26 12:26:59 +00:00
return fmt.Sprintf("<E'Cibo=%t Salute=%d Eta=%d>", e.IsFood, e.Health, e.Age)
2017-05-26 11:14:18 +00:00
}