Advertisement
Guest User

Untitled

a guest
Jul 25th, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. void combination(int... combo){
  2. int index = 0;
  3. for (int i = 0; i < combo.length; i++){
  4. index += dictionary[combo[i]].length;
  5. }
  6.  
  7. if (index == number.length()){
  8. combinations[combCount++] = combo;
  9. return;
  10. }
  11.  
  12. for (int i = 0; i < dictionary.length; i++){
  13. if (isWordAccept(i,index)){
  14. int[] next = new int[combo.length+1];
  15. for (int j = 0; combo.length > 0 && j < combo.length; j++){
  16. next[j] = combo[j];
  17. }
  18. next[next.length-1]=i;
  19. combination(next);
  20. }
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement