package main
import (
"fmt"
"math/rand"
"time"
)
const (
chaosMin = 1
chaosMax = 100
)
func main() {
rand.Seed(time.Now().UnixNano())
// Step 1: Generate a random number representing the level of chaos.
chaosLevel := generateRandomNumber(chaosMin, chaosMax)
// Step 2: Display the generated chaos level.
fmt.Printf("The Colossal God of Chaos has unleashed a chaos level of %d!\n", chaosLevel)
// Step 3: Evaluate the chaos level and respond accordingly.
handleChaos(chaosLevel)
}
// generateRandomNumber generates a random number within the given range.
func generateRandomNumber(min, max int) int {
return rand.Intn(max-min+1) + min
}
// handleChaos evaluates the chaos level and responds accordingly.
func handleChaos(chaosLevel int) {
switch {
case chaosLevel <= 30:
fmt.Println("The world is relatively calm. The Colossal God of Chaos is taking a nap.")
case chaosLevel <= 70:
fmt.Println("The Colossal God of Chaos is stirring, causing some disturbances in the world.")
case chaosLevel <= 90:
fmt.Println("Chaos is rampant! The Colossal God of Chaos is wreaking havoc across the land.")
default:
fmt.Println("The world is in complete chaos! The Colossal God of Chaos is on a rampage!")
}
}