Skip to content

Commit

Permalink
Don't call randomSeed() on every reseed; this was confining us to onl…
Browse files Browse the repository at this point in the history
…y 256

sequences ever displayed.
  • Loading branch information
root committed Aug 30, 2013
1 parent e9673ef commit d3c0154
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/examples/LoLShield_Life/LoLShield_Life.pde
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ int geck = 0; //Counter for re-seeding

void setup() {
LedSign::Init(); //Initilizes the LoL Shield
randomSeed(analogRead(5));
seedWorld();
}

Expand Down Expand Up @@ -83,7 +84,7 @@ void loop() {

//Counts and then checks for re-seeding
//Otherwise the display will die out at some point
if (++geck >= RESEEDRATE || boring >= 5) {
if (boring >= 5 || ++geck >= RESEEDRATE) {
geck = 0;
seedWorld();
}
Expand All @@ -93,7 +94,6 @@ void loop() {

//Re-seeds based off of RESEEDRATE
void seedWorld(){
randomSeed(analogRead(5));
for (byte i = 0; i < SIZEX; i++) {
for (byte j = 0; j < SIZEY; j++) {
if (random(100) < density)
Expand Down

0 comments on commit d3c0154

Please sign in to comment.