Sha256: a0c61a818f3ffc21216959813fdcd2378ad8ef5e0cb3dd52e3dcfba273374611
Contents?: true
Size: 330 Bytes
Versions: 242
Compression:
Stored size: 330 Bytes
Contents
// +build !bonus package robotname import ( "fmt" "math/rand" ) type Robot struct { name string } func (r *Robot) Name() string { if r.name == "" { r.name = fmt.Sprintf("%c%c%03d", 'A'+byte(rand.Intn(26)), 'A'+byte(rand.Intn(26)), rand.Intn(1000)) } return r.name } func (r *Robot) Reset() { *r = Robot{} }
Version data entries
242 entries across 242 versions & 1 rubygems