fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. class PlayableTile {
  11. int getIsTaken() { return 0; }
  12. }
  13.  
  14. PlayableTile[] playableTile;
  15.  
  16. void checkTreeNodes(Object... os) {}
  17.  
  18. public void checkUpTaking(int position, int rowImpact, int takenPawn) { //taken pawn: -1 = brown, 1 = white
  19. new Thread(new Runnable() {
  20. @Override
  21. public void run() {
  22. if (position > 10) { //if you'll try to take from the last row - array out of bounds
  23. if (position % 5 != 0 && playableTile[position - 1 - 4 - rowImpact].getIsTaken() == takenPawn &&
  24. playableTile[position - 1 - 9].getIsTaken() == 0) {
  25. checkTreeNodes(position, position - 9, position-4-rowImpact); //checking possible mandatory moves before clicking pawn
  26. }
  27. if ((position - 1) % 5 != 0 && playableTile[position - 1 - 5 - rowImpact].getIsTaken() == takenPawn &&
  28. playableTile[position - 1 - 11].getIsTaken() == 0) {
  29. checkTreeNodes(position, position - 11, position-5-rowImpact);
  30. }
  31. }
  32. }
  33. }).start();
  34.  
  35. }
  36.  
  37. public static void main (String[] args) throws java.lang.Exception
  38. {
  39. // your code goes here
  40. }
  41. }
Success #stdin #stdout 0.08s 47140KB
stdin
Standard input is empty
stdout
Standard output is empty