The compiler doesn’t like this line:
(1 + roll % 10).as(UInt8)
What is the correct syntax? “roll” is a method returning a random UInt32. I tried replacing 1 with 1_u32, in case it was being taken as signed. The value being made into 8-bit is always in the range 1 … 10, so overflow isn’t a problem. I’m likely overlooking something obvious, due to being brainwashed in other languages that let one cast types as one pleases.