Hello.
Here I am again with my Connect 4 project and another board problem.
This is my code:
fielda = []
fieldb = []
rows = int(raw_input('Height: '))
columns = int(raw_input('Width: '))
if rows < 4:
rows = 4
if columns < 4:
columns = 4
def print_board():
for i in range(columns):
fieldb.append('.')
for i in range(rows):
fielda.append(fieldb)
print ''.join(fieldb)
print_board()
print_board()
print_board()
The first print_board( ) gives out the following (rows = 4, columns = 4):
....
....
....
....
So far, so good.
The second print_board() prints following:
........
........
........
........
The third print_board():
............
............
............
............
Question: Why is the board getting bigger even though nothing has been changed between the first and the last?
Can anybody explain?
Does anybody know how to solve this?(I don't want the board to get bigger)
I don't have a clue what happens there...
Thanks in advance!