Last active
July 24, 2020 14:36
-
-
Save onitonitonito/29264343814dbe54c7d1e0b3a2fd7ea2 to your computer and use it in GitHub Desktop.
To Show Coordination X,Y Numbering on the BOARD (Field)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# show [27x15] text grid board | |
0 . 1 . 2 | |
123456789012345678901234567 | |
1 ........................... 1 | |
2 ........................... 2 | |
3 ........................... 3 | |
4 ........................... 4 | |
5 ........................... 5 | |
6 ........................... 6 | |
7 ........................... 7 | |
8 ........................... 8 | |
9 ........................... 9 | |
10 ........................... 10 | |
11 ........................... 11 | |
12 ........................... 12 | |
13 ........................... 13 | |
14 ........................... 14 | |
15 ........................... 15 | |
0 . 1 . 2 | |
123456789012345678901234567 | |
[Finished in 0.251s] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
# To Show Coordination X,Y Numbering on the BOARD (Field) | |
""" | |
# show_fields_of_board.py | |
BOARD_SIZE = (27, 15) | |
def main(): | |
print('# show [{}x{}] text grid board'.format(*BOARD_SIZE), end='\n\n\n') | |
show_field_screen(board_size=BOARD_SIZE) | |
def show_field_screen(board_size: tuple) -> None: | |
""" 판(BOARD) 크기를 지정하면 필드를 보여준다 """ | |
x_digit_10 = int(board_size[0]/10) | |
x_digit_01 = board_size[0]%10 | |
fields_dots = ["." * board_size[0] for i in range(board_size[1])] | |
cols = int(len(fields_dots[0])/10) | |
print("\t ", " . ".join("012345"[:cols+1])) | |
print("\t ", "1234567890"* (cols) + "123456789"[:x_digit_01]) | |
for i, dots in enumerate(fields_dots): | |
print('\t%2d %s %2d'% (i+1, dots, i+1)) | |
print("\t ", " . ".join("012345"[:cols+1])) | |
print("\t ", "1234567890"* (cols) + "123456789"[:x_digit_01]) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
RESULT of the above