# Failed attempt at using HTML to show a table. # # - do not use # - particularly bad because ultimately we need this printed on paper # - don't be distracted by how close I got # def worksheet(count=5): with open('worksheet.html', 'wt') as fd: P = lambda *a: print(*a, file=fd) P('''
| {dig} | Word #' + ''.join(f' | {n+1}' for n in range(24))) P(' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Word' + ''.join(f' | ' for n in range(24))) P(' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Hex Digit' + ''.join(f' | ' for n in range(24*3))) if c: if c == 1: here = 'A' elif c > 2: here = '...' else: here = '(' + '⊕'.join('%X' % (z+10-1) for z in range(1, c+1)) + ')' P(f' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {here}⊕{dig}' + ''.join(f' | ' for n in range((24*3)-2)) + ' | X | X') if c in {2, 5}: if c == 2: m = 'sane people stop here' else: m = 'please stop, this hurts' P(f' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {m}') P(' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||