reset variable m in the correct place.

This commit is contained in:
Robert May 2015-11-17 18:51:10 +00:00
parent 892689c54a
commit 901faaeec7
1 changed files with 1 additions and 1 deletions

View File

@ -314,8 +314,8 @@ int MicroBit::random(int max)
bits++;
}
m = 0;
do {
m = 0;
for(b=0; b<bits; b++) {
// Cycle the LFSR (Linear Feedback Shift Register).
// We use an optimal sequence with a period of 2^32-1, as defined by Bruce Schneider here (a true legend in the field!),