RosettaCodeData/Task/Singleton/Go/singleton-7.go

25 lines
329 B
Go
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
package main
import (
"log"
"math/rand"
"time"
"blue"
"red"
"single"
)
func main() {
rand.Seed(time.Now().Unix())
switch rand.Intn(3) {
case 1:
red.SetColor()
blue.SetColor()
case 2:
blue.SetColor()
red.SetColor()
}
log.Println(single.Color())
}