Skip to content

Instantly share code, notes, and snippets.

@KHerb
Created July 12, 2016 17:23
Show Gist options
  • Save KHerb/0ef9ff2b6f3cf92ba26fee10407d481f to your computer and use it in GitHub Desktop.
Save KHerb/0ef9ff2b6f3cf92ba26fee10407d481f to your computer and use it in GitHub Desktop.
Gameboard Generator
"""Gameboard Generator"""
columns = int(raw_input("How many columns do you want on your gameboard? "))
rows = int(raw_input("How many rows do you want on your gameboard? "))
def gameboard(columns,rows):
column = []
height = []
for i in range(columns):
column.append("| |")
for i in range(columns):
height.append(" ---- ")
for i in range(rows):
print "".join(height)
print "".join(column)
print "".join(height)
return column,height
gameboard(columns,rows)
@BensonMuriithi
Copy link

BensonMuriithi commented Jul 30, 2016

That's quite good. I did the exercise and your solution is simpler than mine.

I amended it a bit to take out a bug -> https://gist.github.com/BensonMuriithi/24cde0031cf7fb94fa68fc62083d7cac

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