Skip to content

Instantly share code, notes, and snippets.

@onitonitonito
Last active July 24, 2020 14:36
Show Gist options
  • Save onitonitonito/29264343814dbe54c7d1e0b3a2fd7ea2 to your computer and use it in GitHub Desktop.
Save onitonitonito/29264343814dbe54c7d1e0b3a2fd7ea2 to your computer and use it in GitHub Desktop.
To Show Coordination X,Y Numbering on the BOARD (Field)
# 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]
"""
# 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()
@onitonitonito
Copy link
Author

result_grid_board

RESULT of the above

@onitonitonito
Copy link
Author

onitonitonito commented Jul 24, 2020

result_grid_board

the result has been modified!
YOU CAN READ THE COORDINATIONS, EASILY!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment