Skip to content

Instantly share code, notes, and snippets.

@taotao54321
Created August 8, 2018 11:54
Show Gist options
  • Save taotao54321/00f297f2437364778c8e50aa9b4657cd to your computer and use it in GitHub Desktop.
Save taotao54321/00f297f2437364778c8e50aa9b4657cd to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from tabulate import tabulate
TABLE = (
1, 2, 4, 8, 16, 32, 32, 32, 32, 32,
32, 10, 3, 0, 1, 2, 4, 0, 252, 248,
244, 242, 241, 240, 241, 242, 244, 248, 252, 0,
21, 24, 32, 0, 22, 14, 13, 0, 254, 17,
18, 0, 21, 24, 32, 0, 22, 14, 13, 0,
255, 17, 18, 0, 35, 36, 35, 37, 38, 39,
38, 40, 41, 42, 41, 43, 9, 10, 9, 4,
2, 3, 0, 167, 183, 33, 136, 2, 255, 255,
33, 150, 4, 255,
)
TABLE = tuple(map(lambda x: 256 if x == 0 else x, TABLE))
def main():
score_table = []
for i in range(len(TABLE)):
base = sum(TABLE[0:i+1])
score_table.append([i+1, 100*base, 200*base, 300*base])
print(tabulate(score_table, headers=("n", "LOW", "MED", "HI"), tablefmt="html"))
if __name__ == "__main__": main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment