Thanks AD, I'll have a look at that later.
Somewhat better than the awful, awful hack that I came up with:
Ahem.
Somewhat better than the awful, awful hack that I came up with:
Local b:Byte=2 Local nb:Byte shift=2 For i=0 To 7 If (b & Int(Ceil(2^i))) nb :| Int(Ceil(2^(wrapBit(i,shift)))) Next Print Bin(b) Print Bin(nb) Function wrapBit(bitIndex,bitShift) bitIndex :+ bitShift If bitIndex > 7 bitIndex = (bitIndex-8) Return bitIndex End Function
Ahem.