Browse Source

'wc_tool.py' ändern

Real LED string added.
klaute 1 year ago
parent
commit
0afd81421b
1 changed files with 19 additions and 0 deletions
  1. 19
    0
      wc_tool.py

+ 19
- 0
wc_tool.py View File

@@ -29,6 +29,9 @@ import sys
29 29
 # BSECHSFMUHR
30 30
 
31 31
 text = u"ESKISTLFÜNFZEHNZWANZIGDREIVIERTELTGNACHVORJMHALBQZWÖLFPZWEINSIEBENKDREIRHFÜNFELFNEUNVIERWACHTZEHNRSBSECHSFMUHR"
32
+
33
+text_led_order = u"ESKISTLFÜNF" + u"ZEHNZWANZIG"[::-1] + u"DREIVIERTEL" + u"TGNACHVORJM"[::-1] + u"HALBQZWÖLFP" + u"ZWEINSIEBEN"[::-1]  + u"KDREIRHFÜNF" + u"ELFNEUNVIER"[::-1]  + u"WACHTZEHNRS" + u"BSECHSFMUHR"[::-1]
34
+
32 35
 #            0       1        2        3           4        5           6        7       8        9        10       11       12         13       14       15      16       17       18       19       20        21      22
33 36
 words = [ u"ES", u"IST", u"FÜNF", u"ZEHN", u"ZWANZIG", u"DREI", u"VIERTEL", u"NACH", u"VOR", u"HALB", u"ZWÖLF", u"ZWEI", u"EINS", u"SIEBEN", u"DREI", u"FÜNF", u"ELF", u"NEUN", u"VIER", u"ACHT", u"ZEHN", u"SECHS", u"UHR" ]
34 37
 hours = [ 10, 12, 11, 14, 18, 15, 21, 13, 19, 17, 20, 16 ]
@@ -70,10 +73,14 @@ if __name__ == "__main__":
70 73
 
71 74
     print
72 75
 
76
+    max_len = 0
77
+    max_len_str = ""
73 78
     for h in range(0, len(hours)):
74 79
         after_half = 0
75 80
         for i in combinations:
76 81
             sys.stdout.write(str(i) + ": ")
82
+
83
+            s = ""
77 84
             for j in i:
78 85
                 try:
79 86
                     if j == 9 and i[4] == 9:
@@ -81,6 +88,7 @@ if __name__ == "__main__":
81 88
                 except:
82 89
                     pass
83 90
 
91
+                s = s + words[j].encode('utf-8') + " "
84 92
                 sys.stdout.write(words[j].encode('utf-8') + " ")
85 93
 
86 94
             if after_half == 1:
@@ -89,7 +97,18 @@ if __name__ == "__main__":
89 97
                     th = h + 1
90 98
                 else:
91 99
                     th = 0
100
+                s = s + words[hours[th]].encode('utf-8')
92 101
                 print words[hours[th]].encode('utf-8')
93 102
             else:
103
+                s = s + words[hours[h]].encode('utf-8')
94 104
                 print words[hours[h]].encode('utf-8')
95 105
 
106
+            if len(s.replace(" ", "")) > max_len:
107
+                max_len = len(max_len_str.replace(" ", ""))
108
+                max_len_str = s
109
+
110
+    print
111
+    print "Max len: " + str(max_len) + " => " + str(max_len * 0.6) + " A = Imax"
112
+    print "Max len string: " + max_len_str
113
+
114
+print text_led_order.encode("utf-8")

Loading…
Cancel
Save