Пример #1
0
 @Test
 public void case43() {
   int[] cards = {0, 1, 0, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 2, 1, 2, 0, 1, 2, 0, 1, 2};
   int[] shuffle = {
     20, 11, 15, 9, 1, 21, 5, 3, 10, 7, 0, 8, 19, 22, 14, 6, 23, 18, 12, 13, 4, 2, 16, 17
   };
   assertEquals(672, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #2
0
 @Test
 public void case42() {
   int[] cards = {0, 0, 0, 2, 0, 0, 1, 1, 2, 0, 1, 2, 0, 1, 1, 2, 1, 1, 0, 2, 2, 2, 1, 2};
   int[] shuffle = {
     18, 14, 1, 10, 6, 12, 4, 19, 9, 22, 21, 16, 3, 13, 5, 2, 0, 7, 8, 23, 17, 15, 11, 20
   };
   assertEquals(301, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #3
0
 @Test
 public void case41() {
   int[] cards = {2, 2, 0, 2, 0, 0, 2, 0, 2, 1, 1, 2, 1, 0, 1, 1, 1, 1, 2, 2, 1, 0, 0, 0};
   int[] shuffle = {
     22, 16, 6, 5, 10, 7, 23, 13, 9, 12, 15, 0, 3, 8, 18, 1, 20, 2, 19, 21, 4, 11, 17, 14
   };
   assertEquals(116, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #4
0
 @Test
 public void case40() {
   int[] cards = {0, 0, 2, 1, 1, 0, 2, 1, 0, 2, 1, 2, 0, 0, 2, 2, 0, 0, 1, 1, 2, 1, 2, 1};
   int[] shuffle = {
     11, 4, 12, 22, 8, 21, 20, 14, 2, 7, 5, 19, 13, 15, 17, 23, 3, 10, 6, 0, 1, 16, 9, 18
   };
   assertEquals(213, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #5
0
 @Test
 public void case39() {
   int[] cards = {0, 1, 0, 2, 2, 1, 2, 0, 2, 0, 0, 1, 1, 0, 0, 1, 2, 0, 2, 2, 1, 1, 2, 1};
   int[] shuffle = {
     6, 22, 1, 20, 14, 8, 23, 2, 16, 9, 0, 15, 19, 5, 3, 18, 21, 12, 7, 17, 10, 13, 11, 4
   };
   assertEquals(649, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #6
0
 @Test
 public void case48() {
   int[] cards = {2, 0, 2, 0, 0, 0, 2, 1, 2, 1, 1, 1, 0, 0, 1, 2, 1, 2, 0, 0, 2, 1, 2, 1, 0, 1, 2};
   int[] shuffle = {
     5, 15, 17, 3, 9, 13, 7, 0, 22, 24, 23, 16, 4, 14, 18, 26, 1, 20, 12, 25, 2, 19, 21, 8, 6, 10,
     11
   };
   assertEquals(146, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #7
0
 @Test
 public void case47() {
   int[] cards = {0, 1, 2, 2, 1, 0, 1, 0, 1, 2, 0, 2, 2, 1, 1, 2, 2, 1, 1, 0, 2, 0, 2, 0, 0, 1, 0};
   int[] shuffle = {
     11, 16, 24, 10, 22, 19, 3, 14, 25, 13, 5, 0, 26, 23, 12, 7, 17, 18, 6, 1, 2, 21, 8, 4, 20, 9,
     15
   };
   assertEquals(474, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #8
0
 @Test
 public void case46() {
   int[] cards = {2, 1, 0, 1, 0, 2, 2, 1, 0, 1, 1, 2, 0, 1, 0, 0, 2, 0, 1, 1, 1, 0, 2, 2, 2, 2, 0};
   int[] shuffle = {
     26, 23, 22, 16, 14, 11, 25, 5, 24, 20, 1, 7, 10, 4, 2, 0, 8, 3, 15, 9, 6, 21, 18, 12, 17, 13,
     19
   };
   assertEquals(396, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #9
0
 @Test
 public void case45() {
   int[] cards = {0, 2, 2, 1, 0, 0, 2, 2, 1, 0, 0, 2, 2, 2, 1, 0, 2, 1, 1, 1, 1, 2, 0, 1, 0, 0, 1};
   int[] shuffle = {
     20, 3, 11, 16, 12, 10, 18, 24, 25, 9, 6, 17, 2, 14, 22, 15, 26, 4, 21, 19, 7, 8, 23, 1, 13, 5,
     0
   };
   assertEquals(381, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #10
0
 @Test
 public void case44() {
   int[] cards = {1, 1, 0, 1, 1, 2, 2, 2, 0, 0, 0, 1, 0, 1, 2, 0, 1, 2, 0, 2, 0, 0, 2, 1, 1, 2, 2};
   int[] shuffle = {
     20, 11, 21, 8, 1, 14, 3, 9, 10, 24, 12, 26, 6, 2, 5, 13, 4, 22, 0, 18, 15, 7, 16, 17, 19, 23,
     25
   };
   assertEquals(17, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #11
0
 @Test
 public void case52() {
   int[] cards = {
     1, 2, 2, 2, 0, 0, 1, 2, 0, 0, 0, 1, 2, 1, 1, 0, 0, 2, 2, 1, 1, 0, 2, 2, 1, 0, 1, 2, 0, 1
   };
   int[] shuffle = {
     19, 9, 2, 29, 1, 6, 14, 11, 12, 17, 18, 13, 26, 28, 4, 27, 15, 0, 5, 10, 16, 3, 23, 8, 7, 24,
     22, 20, 21, 25
   };
   assertEquals(1261, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #12
0
 @Test
 public void case51() {
   int[] cards = {
     2, 1, 2, 2, 1, 2, 2, 1, 0, 2, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 2, 2, 1, 1, 0, 0, 2, 2, 0, 0
   };
   int[] shuffle = {
     29, 26, 14, 9, 17, 1, 15, 4, 25, 6, 16, 8, 11, 23, 12, 20, 7, 27, 19, 24, 2, 13, 5, 0, 18, 3,
     22, 28, 10, 21
   };
   assertEquals(1434, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #13
0
 @Test
 public void case50() {
   int[] cards = {
     1, 1, 2, 0, 2, 0, 0, 2, 0, 2, 0, 1, 0, 2, 0, 0, 1, 1, 0, 1, 2, 2, 1, 2, 2, 1, 0, 1, 1, 2
   };
   int[] shuffle = {
     2, 8, 12, 6, 24, 0, 14, 18, 20, 5, 25, 19, 9, 16, 7, 28, 1, 26, 21, 22, 29, 27, 13, 15, 10, 4,
     11, 3, 23, 17
   };
   assertEquals(-1, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #14
0
 @Test
 public void case53() {
   int[] cards = {
     1, 0, 1, 2, 1, 0, 1, 2, 2, 0, 0, 1, 0, 2, 0, 0, 1, 1, 2, 2, 0, 2, 0, 1, 1, 2, 1, 0, 2, 2
   };
   int[] shuffle = {
     11, 6, 23, 28, 24, 17, 20, 10, 3, 16, 14, 7, 22, 2, 27, 9, 15, 8, 12, 13, 29, 0, 4, 19, 1, 26,
     18, 21, 5, 25
   };
   assertEquals(2298, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #15
0
 @Test
 public void case93() {
   int[] cards = {
     0, 2, 2, 1, 1, 2, 1, 2, 2, 1, 0, 1, 0, 0, 2, 2, 1, 0, 2, 1, 1, 0, 2, 0, 2, 0, 2, 0, 0, 0, 1,
     2, 1, 1, 0, 1, 0, 0, 1, 1, 2, 2, 0, 1, 1, 2, 2, 0
   };
   int[] shuffle = {
     12, 44, 13, 28, 43, 35, 0, 47, 8, 46, 6, 25, 37, 14, 21, 20, 22, 26, 23, 32, 18, 41, 29, 2,
     17, 3, 40, 9, 27, 36, 34, 4, 31, 16, 30, 7, 33, 19, 1, 10, 38, 15, 45, 39, 24, 11, 5, 42
   };
   assertEquals(65911, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #16
0
 @Test
 public void case91() {
   int[] cards = {
     1, 1, 2, 0, 2, 2, 1, 1, 1, 0, 1, 2, 0, 1, 2, 0, 1, 0, 0, 2, 2, 1, 1, 0, 0, 1, 2, 0, 1, 2, 0,
     1, 2, 0, 2, 2, 0, 1, 1, 0, 0, 2, 2, 0, 2, 1, 2, 0
   };
   int[] shuffle = {
     43, 2, 8, 37, 15, 44, 35, 39, 19, 20, 25, 45, 5, 3, 22, 46, 13, 34, 29, 14, 31, 38, 26, 21, 6,
     12, 1, 16, 4, 42, 18, 32, 9, 7, 24, 11, 41, 33, 0, 27, 47, 36, 40, 28, 10, 30, 23, 17
   };
   assertEquals(14880, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #17
0
 @Test
 public void case92() {
   int[] cards = {
     0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 1, 1, 2, 1, 0, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 0, 0, 2, 0, 1,
     1, 0, 2, 0, 1, 1, 0, 0, 1, 0, 2, 0, 0, 1, 2, 2, 2
   };
   int[] shuffle = {
     20, 2, 15, 10, 4, 26, 16, 18, 27, 33, 37, 3, 42, 25, 31, 46, 32, 1, 38, 28, 5, 13, 0, 9, 17,
     40, 19, 43, 41, 23, 7, 21, 12, 8, 45, 34, 14, 39, 22, 11, 36, 44, 24, 47, 30, 35, 6, 29
   };
   assertEquals(99733, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #18
0
 @Test
 public void case89() {
   int[] cards = {
     0, 2, 0, 0, 2, 1, 1, 2, 1, 0, 2, 1, 0, 2, 2, 2, 0, 1, 0, 0, 0, 1, 1, 1, 2, 2, 1, 0, 2, 1, 2,
     0, 0, 0, 1, 0, 1, 0, 2, 2, 2, 1, 1, 1, 2, 0, 1, 2
   };
   int[] shuffle = {
     37, 2, 41, 32, 11, 34, 33, 29, 38, 35, 36, 28, 42, 6, 12, 16, 19, 4, 45, 5, 30, 15, 26, 20,
     23, 7, 39, 18, 47, 46, 1, 22, 10, 3, 44, 13, 31, 40, 0, 9, 14, 25, 8, 43, 21, 27, 24, 17
   };
   assertEquals(34956, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #19
0
 @Test
 public void case90() {
   int[] cards = {
     0, 1, 1, 1, 2, 2, 0, 0, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 2,
     1, 2, 2, 0, 1, 1, 0, 1, 1, 1, 2, 2, 1, 0, 0, 2, 1
   };
   int[] shuffle = {
     44, 21, 26, 31, 7, 32, 33, 28, 18, 20, 42, 38, 29, 11, 8, 37, 2, 46, 5, 19, 1, 14, 9, 43, 45,
     41, 24, 6, 4, 0, 25, 22, 35, 34, 47, 3, 23, 10, 17, 40, 16, 12, 39, 27, 30, 15, 13, 36
   };
   assertEquals(-1, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #20
0
 @Test
 public void case87() {
   int[] cards = {
     0, 2, 1, 1, 0, 2, 0, 2, 0, 0, 2, 0, 0, 1, 1, 2, 2, 0, 2, 2, 2, 1, 0, 0, 1, 2, 1, 2, 1, 2, 2,
     1, 0, 0, 0, 1, 0, 2, 2, 1, 1, 1, 1, 0, 1
   };
   int[] shuffle = {
     36, 41, 23, 10, 24, 43, 9, 0, 19, 35, 40, 16, 29, 1, 13, 11, 27, 32, 25, 33, 8, 38, 28, 14, 4,
     18, 2, 5, 21, 20, 37, 12, 26, 15, 39, 6, 30, 7, 3, 17, 44, 34, 22, 31, 42
   };
   assertEquals(-1, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #21
0
 @Test
 public void case88() {
   int[] cards = {
     2, 1, 1, 1, 0, 2, 1, 2, 2, 2, 1, 0, 0, 1, 0, 2, 0, 2, 0, 1, 0, 1, 1, 2, 0, 1, 0, 1, 2, 2, 2,
     1, 1, 0, 1, 0, 0, 2, 0, 2, 1, 0, 0, 2, 2
   };
   int[] shuffle = {
     26, 31, 19, 41, 15, 33, 30, 6, 38, 11, 34, 28, 13, 36, 37, 17, 9, 44, 32, 1, 7, 25, 27, 3, 35,
     4, 21, 24, 23, 12, 16, 43, 20, 10, 29, 39, 5, 22, 42, 14, 2, 18, 0, 40, 8
   };
   assertEquals(23288, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #22
0
 @Test
 public void case86() {
   int[] cards = {
     2, 1, 2, 0, 1, 0, 0, 2, 2, 2, 1, 1, 1, 0, 0, 1, 0, 1, 2, 1, 0, 0, 0, 1, 1, 2, 2, 0, 2, 1, 0,
     0, 2, 1, 1, 0, 2, 1, 2, 2, 2, 2, 1, 0, 0
   };
   int[] shuffle = {
     13, 30, 18, 5, 10, 22, 7, 40, 41, 24, 33, 2, 16, 15, 27, 31, 36, 43, 44, 6, 21, 12, 9, 35, 3,
     37, 19, 39, 1, 34, 29, 11, 8, 17, 42, 26, 14, 4, 20, 38, 28, 32, 23, 25, 0
   };
   assertEquals(26983, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #23
0
 @Test
 public void case85() {
   int[] cards = {
     2, 1, 1, 0, 0, 0, 1, 2, 2, 1, 2, 0, 2, 0, 2, 1, 0, 0, 0, 0, 2, 0, 1, 1, 2, 2, 1, 2, 0, 2, 2,
     2, 2, 1, 0, 0, 1, 1, 0, 1, 1, 2, 1, 0, 2
   };
   int[] shuffle = {
     17, 43, 32, 20, 34, 6, 33, 38, 2, 13, 26, 30, 22, 28, 7, 0, 36, 12, 40, 9, 16, 39, 35, 14, 23,
     8, 37, 15, 18, 41, 44, 24, 29, 1, 3, 4, 27, 10, 5, 42, 21, 25, 19, 31, 11
   };
   assertEquals(-1, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #24
0
 @Test
 public void case84() {
   int[] cards = {
     1, 1, 2, 1, 0, 2, 0, 1, 2, 2, 1, 2, 0, 2, 0, 0, 1, 1, 2, 2, 2, 2, 0, 2, 1, 0, 1, 0, 1, 0, 0,
     1, 0, 0, 0, 2, 2, 1, 2, 0, 0, 2, 1, 1, 1
   };
   int[] shuffle = {
     40, 38, 8, 43, 24, 14, 17, 20, 1, 23, 34, 32, 7, 26, 15, 42, 16, 36, 5, 44, 33, 11, 3, 29, 19,
     35, 4, 12, 13, 18, 30, 41, 39, 31, 0, 6, 25, 10, 27, 21, 9, 2, 37, 22, 28
   };
   assertEquals(19657, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #25
0
 @Test
 public void case94() {
   int[] cards = {
     1, 0, 1, 2, 2, 0, 0, 0, 0, 1, 1, 2, 0, 0, 1, 0, 2, 0, 0, 2, 0, 2, 0, 2, 0, 2, 1, 0, 1, 1, 2,
     1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 0, 1, 0, 1
   };
   int[] shuffle = {
     33, 9, 13, 30, 23, 40, 24, 22, 42, 5, 38, 6, 46, 39, 32, 2, 20, 4, 27, 25, 41, 1, 0, 35, 11,
     26, 29, 8, 7, 43, 12, 10, 16, 19, 14, 3, 34, 31, 37, 47, 45, 36, 44, 28, 21, 18, 15, 17
   };
   assertEquals(33252, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #26
0
 @Test
 public void case96() {
   int[] cards = {
     0, 1, 2, 1, 1, 0, 2, 2, 2, 1, 2, 1, 2, 2, 2, 0, 2, 1, 1, 0, 0, 1, 2, 2, 1, 2, 0, 1, 0, 0, 2,
     1, 0, 2, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 2, 0, 2, 0
   };
   int[] shuffle = {
     33, 10, 39, 41, 37, 44, 40, 6, 2, 43, 20, 0, 35, 17, 25, 21, 18, 1, 14, 38, 36, 28, 47, 22,
     31, 3, 7, 30, 12, 26, 45, 13, 16, 23, 24, 4, 9, 15, 27, 8, 19, 46, 5, 34, 11, 29, 42, 32
   };
   assertEquals(16248, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #27
0
 @Test
 public void case95() {
   int[] cards = {
     2, 2, 0, 2, 0, 1, 1, 0, 2, 1, 1, 1, 0, 0, 2, 2, 1, 2, 0, 2, 2, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1,
     2, 0, 2, 0, 0, 0, 2, 2, 1, 1, 1, 2, 2, 2, 0, 1, 0
   };
   int[] shuffle = {
     18, 10, 8, 2, 35, 12, 36, 16, 29, 45, 25, 24, 44, 15, 40, 11, 27, 13, 32, 6, 4, 17, 23, 33,
     14, 26, 1, 7, 34, 28, 20, 30, 19, 22, 5, 9, 47, 41, 37, 46, 21, 0, 43, 39, 42, 31, 3, 38
   };
   assertEquals(8339, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #28
0
 @Test
 public void case81() {
   int[] cards = {
     0, 2, 0, 1, 0, 0, 2, 2, 2, 1, 2, 0, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 0, 0, 2, 1, 0, 2, 2, 1, 0,
     0, 0, 0, 0, 2, 0, 1, 2, 0, 2, 1, 1, 1, 2
   };
   int[] shuffle = {
     13, 4, 11, 9, 3, 34, 18, 42, 17, 2, 29, 12, 1, 15, 28, 23, 10, 22, 14, 19, 39, 5, 41, 25, 38,
     0, 44, 26, 32, 37, 7, 30, 20, 35, 6, 21, 36, 16, 43, 40, 33, 31, 24, 8, 27
   };
   assertEquals(48557, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #29
0
 @Test
 public void case97() {
   int[] cards = {
     0, 2, 2, 2, 0, 2, 1, 1, 2, 0, 2, 1, 2, 0, 0, 0, 2, 0, 0, 2, 1, 0, 2, 1, 2, 0, 0, 0, 1, 1, 1,
     1, 1, 0, 1, 1, 1, 1, 2, 2, 1, 0, 0, 2, 1, 0, 2, 2
   };
   int[] shuffle = {
     13, 6, 10, 34, 18, 39, 45, 40, 43, 24, 7, 12, 15, 32, 4, 0, 44, 27, 1, 28, 41, 33, 46, 47, 14,
     23, 16, 9, 30, 5, 26, 29, 8, 17, 22, 37, 21, 20, 19, 25, 31, 3, 35, 11, 38, 36, 42, 2
   };
   assertEquals(70223, cardscheating.numberOfShuffles(cards, shuffle));
 }
Пример #30
0
 @Test
 public void case82() {
   int[] cards = {
     0, 1, 2, 1, 1, 0, 2, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 2, 0, 1, 2, 1, 1, 2, 2, 1, 2, 2, 2, 1, 0,
     0, 0, 0, 1, 2, 2, 1, 2, 0, 2, 2, 2, 1, 0
   };
   int[] shuffle = {
     32, 9, 1, 21, 5, 2, 8, 36, 44, 20, 14, 35, 22, 41, 7, 37, 29, 15, 24, 39, 28, 0, 43, 34, 6,
     13, 26, 40, 19, 42, 38, 3, 11, 17, 4, 27, 16, 33, 12, 23, 31, 30, 10, 25, 18
   };
   assertEquals(27232, cardscheating.numberOfShuffles(cards, shuffle));
 }