Make a counter roll over up or down.
tenrdrmer
Member, Sous Chef, Senior Sous-Chef Posts: 9,934
So I know how to make a counter rollover from say 10 back to 1 but how do you make it go from 1 to 10 so that it can go either way?
Comments
self.count to (self.count-1)%11 counts down from 10 to zero
self.count to (self.count+1)%11 counts from from 1 to zero via 10
so I guess you would just replace the +-1 with a switching attribute