Yet more string foermatting

This commit is contained in:
Nox Sluijtman 2022-07-29 13:30:48 +02:00
parent 349f882ade
commit 852bd4c906

11
main.go
View file

@ -47,11 +47,6 @@ func main() {
} }
default: default:
if diceThrows <= 1 {
fmt.Println(string(ColorYellow), "Rolling die...:", string(ColorReset))
} else{
fmt.Println(string(ColorYellow), "Rolling",diceThrows,"dice...:", string(ColorReset))
}
Cast(surfaces, diceThrows) Cast(surfaces, diceThrows)
} }
} }
@ -91,6 +86,12 @@ func Cast(dieSurfaces, castAmount int) {
fmt.Println(string(ColorBlue), "\tIndividual rolls:", casts, string(ColorReset)) fmt.Println(string(ColorBlue), "\tIndividual rolls:", casts, string(ColorReset))
} }
if modifier != 0 {
fmt.Printf("%sRolling %dd%d + %d...\n%s", ColorYellow, diceThrows, surfaces, modifier, ColorReset)
} else {
fmt.Printf("%sRolling %dd%d...\n%s", ColorYellow, diceThrows, surfaces, ColorReset)
}
if modifier != 0 { if modifier != 0 {
fmt.Println("\tWithout modifier:", total) fmt.Println("\tWithout modifier:", total)
fmt.Println(string(ColorGreen), "\tWith modifier:", total+modifier, string(ColorReset)) fmt.Println(string(ColorGreen), "\tWith modifier:", total+modifier, string(ColorReset))