ljukk

Untitled

Dec 14th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. package javaapplication61;
  2.  
  3. /**
  4. *
  5. * @author sused
  6. */
  7. public class JKinosala {
  8.  
  9. public static void VyprazdniKino(boolean[][] k) {
  10. for (int r = 0; r < k.length; r++) {
  11. for (int s = 0; s < k[r].length; s++) {
  12. k[r][s] = true;
  13. }
  14. }
  15. }
  16.  
  17. public static void ZobrazKino(boolean[][] k) {
  18. for (int r = 0; r < k.length; r++) {
  19. for (int s = 0; s < k[r].length; s++) {
  20. if (k[r][s]) {
  21. System.out.print("0 ");
  22. } else {
  23. System.out.print("1 ");
  24. }
  25. }
  26. System.out.println();
  27.  
  28. }
  29.  
  30. }
  31.  
  32. public static boolean JeVolne(boolean[][] k, int r, int s) {
  33. return k[r][s];
  34.  
  35. }
  36.  
  37. public static boolean PosadSa(boolean [][] k, int r, int s) {
  38. if (JeVolne(k, r, s)) {
  39. k[r][s] = false;
  40. return true;
  41. }
  42. else return false;
  43. }
  44. }
Add Comment
Please, Sign In to add comment