Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: d6dab77f2b
Fetching contributors…

Cannot retrieve contributors at this time

32 lines (21 sloc) 0.631 kb
# User only to make a set number of guesses
# Game Board into a class
# allow for words of Any size
class Board(object):
def __init__(self, wordsize = 5, guesses = 5):
self.wordsize = wordsize
self.guesses = guesses
self.board = []
for i in range(self.guesses):
self.board.append(['*'] * self.wordsize)
def printBoard(self):
print '+' + "---+" * self.wordsize
for row in range(self.guesses):
strRow = '|'
for col in range(self.wordsize):
strRow += ' %s |' % (self.board[row][col])
print strRow
print '+' + "---+" * self.wordsize
if __name__ == "__main__":
b = Board()
b.printBoard()
Jump to Line
Something went wrong with that request. Please try again.