Last active
March 31, 2017 09:11
-
-
Save FardinBehboudi/56e2a7149eaa5bb7e9caf1affd95a730 to your computer and use it in GitHub Desktop.
This code will drow a N*M board on Screen Python
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
# 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