Skip to content

Instantly share code, notes, and snippets.

@FardinBehboudi
Last active March 31, 2017 09:11
Show Gist options
  • Save FardinBehboudi/56e2a7149eaa5bb7e9caf1affd95a730 to your computer and use it in GitHub Desktop.
Save FardinBehboudi/56e2a7149eaa5bb7e9caf1affd95a730 to your computer and use it in GitHub Desktop.
This code will drow a N*M board on Screen Python
# this program Draws a board in screen
from operator import index
def ho_line(boardsize_ho, boardsize_vo):
print " --- " * boardsize_ho * (boardsize_vo +1)
def ve_lone(boardsize_ho, boardsize_vo):
print '| ' * (boardsize_ho + 1) * boardsize_vo
def main():
boardsize_ho = int(raw_input('please enter the board horzintal size: '))
boardsize_ve = int(raw_input('please enter the board vertical size: '))
for index in range(boardsize_ho):
ho_line(boardsize_ho, boardsize_ve)
ve_lone(boardsize_ho, boardsize_ve)
ho_line(boardsize_ho, boardsize_ve)
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment