コード例 #1
0
def integratedLevel(numbers: str, sublength: int):
    from probs.prob02_algospot_pi.pi import subSameNumber, subSimpleIncrease, \
        subSimpleDecrease, subRotate, subArithmeticSequence

    if subSameNumber(numbers, sublength):
        return 1

    if subSimpleIncrease(numbers, sublength):
        return 2

    if subSimpleDecrease(numbers, sublength):
        return 2

    if subRotate(numbers, sublength):
        return 4

    if subArithmeticSequence(numbers, sublength):
        return 5

    return 10
コード例 #2
0
 def test_subSimpleDecrease_8(self):
     self.assertEqual(subSimpleDecrease('43214', 5), False)
コード例 #3
0
 def test_subSimpleDecrease_6(self):
     self.assertEqual(subSimpleDecrease('3212', 3), False)
コード例 #4
0
 def test_subSimpleDecrease_7(self):
     self.assertEqual(subSimpleDecrease('3213', 4), False)
コード例 #5
0
 def test_subSimpleDecrease_5(self):
     self.assertEqual(subSimpleDecrease('1210', 3), True)
コード例 #6
0
 def test_subSimpleDecrease_4(self):
     self.assertEqual(subSimpleDecrease('1432', 3), True)
コード例 #7
0
 def test_subSimpleDecrease_3(self):
     self.assertEqual(subSimpleDecrease('154321', 5), True)
コード例 #8
0
 def test_subSimpleDecrease_2(self):
     self.assertEqual(subSimpleDecrease('14321', 4), True)
コード例 #9
0
 def test_subSimpleDecrease_1(self):
     self.assertEqual(subSimpleDecrease('1321', 3), True)