Skip to content

Instantly share code, notes, and snippets.

@Yatekii
Created February 23, 2014 15:20
Show Gist options
  • Save Yatekii/9172739 to your computer and use it in GitHub Desktop.
Save Yatekii/9172739 to your computer and use it in GitHub Desktop.
public void generate(int[] standings){
int[] copy = new int[10];
System.arraycopy( standings, 0, copy, 0, standings.length );
table[copy[0] * 1 + copy[1] * 3 + copy[2] * 9 + copy[3] * 27 + copy[4] * 81 + copy[5] * 243
+ copy[6] * 729 + copy[7] * 2187 + copy[8] * 6561 + copy[9] * 19683] = 1;
for(int i = 0; i < 10; i++){
if(copy[i] < 2){
copy[i]++;
generate(copy);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment