Exemple #1
0
 @Test
 public void testVanemeglepes() {
   int[][] sajat = {
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 1, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 9, 9, 9, 9},
     {0, 0, 0, 0, 0, 9, 9, 9, 9},
     {0, 0, 0, 0, 0, 9, 9, 9, 9},
     {0, 0, 0, 0, 0, 9, 9, 9, 0},
   };
   Lep vm = new Lep(1, 2, 3, 3, sajat);
   assertTrue(vm.vanemeglepes());
   Lep vm2 = new Lep(7, 7, 1, 2, sajat);
   assertFalse(vm2.vanemeglepes());
 }
Exemple #2
0
 @Test
 public void testLepes() {
   int[][] sajat = {
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 1, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
   };
   Lep vm = new Lep(1, 2, 3, 3, sajat);
   assertTrue(vm.lepes());
   Lep vm2 = new Lep(1, 2, 1, 2, sajat);
   assertFalse(vm2.lepes());
 }
Exemple #3
0
 @Test
 public void testNemfoglalt() {
   int[][] sajat = {
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 1, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
   };
   Lep vm = new Lep(1, 2, 3, 3, sajat);
   assertTrue(vm.nemfoglalt());
   Lep vm2 = new Lep(1, 2, 1, 2, sajat);
   assertFalse(vm2.nemfoglalt());
 }
Exemple #4
0
 @Test
 public void testTablanvan() {
   int[][] sajat = {
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 1, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
   };
   Lep vm = new Lep(1, 2, 3, 3, sajat);
   assertTrue(vm.tablanvan());
   Lep vm2 = new Lep(1, 2, 9, 9, sajat);
   assertFalse(vm2.tablanvan());
 }
Exemple #5
0
 @Test
 public void testSzabalyose() {
   int[][] sajat = {
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 1, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0, 0},
   };
   Lep vm = new Lep(1, 2, 3, 3, sajat);
   assertTrue(vm.szabalyose());
   Lep vm2 = new Lep(1, 2, 1, 2, sajat);
   assertFalse(vm2.szabalyose());
   Lep vm3 = new Lep(1, 2, 3, 2, sajat);
   assertFalse(vm3.szabalyose());
   Lep vm4 = new Lep(1, 2, 2, 4, sajat);
   assertTrue(vm4.szabalyose());
   Lep vm5 = new Lep(1, 2, 1, 4, sajat);
   assertFalse(vm5.szabalyose());
 }