Skip to content

Instantly share code, notes, and snippets.

@NeuroWinter
Created May 22, 2014 02:45
Show Gist options
  • Save NeuroWinter/b761d71de1c775d27709 to your computer and use it in GitHub Desktop.
Save NeuroWinter/b761d71de1c775d27709 to your computer and use it in GitHub Desktop.
if else loop
for (int i = 0; i < length ; i++ ) {
double ran = Math.random();
if(ran <= 0.25){
seqence[i] = 'a';
}else if( ran < 0.25 && ran<=0.5 ){
seqence[i] = 'c';
}else if( ran < 0.5 && ran <= 0.75 ){
seqence[i] = 'g';
}else{
seqence[i] = 't';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment