Skip to content

Instantly share code, notes, and snippets.

@y1n0
Created March 1, 2017 00:59
Show Gist options
  • Select an option

  • Save y1n0/ab53842f5a4ecf916ace53491089649c to your computer and use it in GitHub Desktop.

Select an option

Save y1n0/ab53842f5a4ecf916ace53491089649c to your computer and use it in GitHub Desktop.
practicepython.org; ex 24
#!/usr/bin/python3.5
def grid(x=1, y=1):
hor_line = ' ---'
ver_line = '| '
print(hor_line*x)
for i in range(y):
print(ver_line*x+'|')
print(hor_line*x)
def extract_size(s):
x = int(s.split('x')[0])
y = int(s.split('x')[1])
return x,y
print('·-----------------------------·')
print('| WELCOME TO TIC TAC TOW GAME |')
print('·-----------------------------·')
print('\nCurrently the game is not ready to play, but you still however can choose your board\'s size.')
size = input('enter the board size (in \'a x b\' format)')
grid(*extract_size(size))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment