I have been trying to take elements from a array and put them into a 2d array and I was wondering if there was a way to do that?
for example
h = ['H', 'H', 'H', 'H', 'H', 'H', 'H', 'H', 'T']
a = Grid(3,3) #creates empty 2d array
output would be
H H H
H H H
H H T
I been doing something likes this.
for row in range(a.getHeight()):
for col in range(a.getWidth():
for i in range(len(h):
a[row][col] = h[i]
but i get this as the output:
T T T
T T T
T T T