1. Python / Говнокод #23190

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    class Cell:
        def __init__(self, row_id, column_id):
            """Описание ячейки в матрице"""
            """Определение первой буквы в ячейке"""
            if row_id == 0:
                self.cell_letter_1 = 'A'
            elif row_id == 1:
                self.cell_letter_1 = 'K'
            elif row_id == 2:
                self.cell_letter_1 = 'Q'
            elif row_id == 3:
                self.cell_letter_1 = 'J'
            elif row_id == 4:
                self.cell_letter_1 = 'T'
            elif row_id == 5:
                self.cell_letter_1 = '9'
            elif row_id == 6:
                self.cell_letter_1 = '8'
            elif row_id == 7:
                self.cell_letter_1 = '7'
            elif row_id == 8:
                self.cell_letter_1 = '6'
            elif row_id == 9:
                self.cell_letter_1 = '5'
            elif row_id == 10:
                self.cell_letter_1 = '4'
            elif row_id == 11:
                self.cell_letter_1 = '3'
            elif row_id == 12:
                self.cell_letter_1 = '2'
            """Определение второй буквы в ячейке"""
            if column_id == 0:
                self.cell_letter_2 = 'A'
            elif column_id == 1:
                self.cell_letter_2 = 'K'
            elif column_id == 2:
                self.cell_letter_2 = 'Q'
            elif column_id == 3:
                self.cell_letter_2 = 'J'
            elif column_id == 4:
                self.cell_letter_2 = 'T'
            elif column_id == 5:
                self.cell_letter_2 = '9'
            elif column_id == 6:
                self.cell_letter_2 = '8'
            elif column_id == 7:
                self.cell_letter_2 = '7'
            elif column_id == 8:
                self.cell_letter_2 = '6'
            elif column_id == 9:
                self.cell_letter_2 = '5'
            elif column_id == 10:
                self.cell_letter_2 = '4'
            elif column_id == 11:
                self.cell_letter_2 = '3'
            elif column_id == 12:
                self.cell_letter_2 = '2'
            """Установка порядка отойбражения 1-й и 2-й буквы в ячейке"""
            if row_id == 0:
                self.cell_text = self.cell_letter_1 + self.cell_letter_2
            elif row_id == 1 and column_id >= 2:
                self.cell_text = self.cell_letter_1 + self.cell_letter_2
            elif row_id == 2 and column_id >= 3:
                self.cell_text = self.cell_letter_1 + self.cell_letter_2
            elif row_id == 3 and column_id >= 4:
                self.cell_text = self.cell_letter_1 + self.cell_letter_2
            elif row_id == 4 and column_id >= 5:
                self.cell_text = self.cell_letter_1 + self.cell_letter_2
            elif row_id == 5 and column_id >= 6:
                self.cell_text = self.cell_letter_1 + self.cell_letter_2
            elif row_id == 6 and column_id >= 7:
                self.cell_text = self.cell_letter_1 + self.cell_letter_2
            elif row_id == 7 and column_id >= 8:
                self.cell_text = self.cell_letter_1 + self.cell_letter_2
            elif row_id == 8 and column_id >= 9:
                self.cell_text = self.cell_letter_1 + self.cell_letter_2
            elif row_id == 9 and column_id >= 10:
                self.cell_text = self.cell_letter_1 + self.cell_letter_2
            elif row_id == 10 and column_id >= 11:
                self.cell_text = self.cell_letter_1 + self.cell_letter_2
            elif row_id == 11 and column_id == 12:
                self.cell_text = self.cell_letter_1 + self.cell_letter_2
            else:
                self.cell_text = self.cell_letter_2 + self.cell_letter_1

    http://python.su/forum/topic/33195/?page=1#post-181430

    Запостил: FishHook, 17 Июля 2017

    Комментарии (1) RSS

    Добавить комментарий