Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't Want Random Effects #1

Open
LedArts opened this issue Feb 17, 2017 · 6 comments
Open

don't Want Random Effects #1

LedArts opened this issue Feb 17, 2017 · 6 comments

Comments

@LedArts
Copy link

LedArts commented Feb 17, 2017

hello sir, i try this program but i don't want to run random effects every time. i want to serial wise effects as i write in program. Can u please stop the shuffle or random function. n give me serial wise code.

thank you

@sfrwmaker
Copy link
Owner

sfrwmaker commented Feb 17, 2017 via email

@LedArts
Copy link
Author

LedArts commented Feb 17, 2017

sir can u give me any example how to write it....

@sfrwmaker
Copy link
Owner

sfrwmaker commented Feb 17, 2017 via email

@LedArts
Copy link
Author

LedArts commented Feb 17, 2017

thank you so much sir
i try it and no error occur. but i have one more question in "void shuffle::randomize(void)" there is any change in this function or it will be as it is.

byte shuffle::next(void) {
if (curr >= num_anim) curr = 0;
return index[curr++];
}
void shuffle::randomize(void) {
for (byte i = 0; i < num_anim*2; ++i) {
byte p1 = random(num_anim);
byte p2 = random(num_anim);
if (p1 != p2) {
byte t = index[p2];
index[p2] = index[p1];
index[p1] = t;
}
}
curr = 0;
}

@sfrwmaker
Copy link
Owner

sfrwmaker commented Feb 17, 2017 via email

@LedArts
Copy link
Author

LedArts commented Feb 17, 2017

thanxxxxxxxxxxxxxxxxxxxxxx lot sir.......
it works.......
i am working on this code from last 7 days i hve one more issue which i am posting in next issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants