L = [[" " for i in range(10)] for j in range(10)]
for i in range (10):
L[9][i]="*"
for i in range (10):
L[8][i]="1"
for i in range (10):
L[7][i]="*"
for i in range (10):
L[6][i]="3"
for i in range (10):
L[5][i]="*"
print(L)
print()
def Check_Lines(l):
for i in range (10):
x=l[i].count("*")
if x == 10:
print ("LINE IS FULL")
del l[i]
l.reverse()
l.append([" "," "," "," "," "," "," "," "," "," "])
l.reverse()
Check_Lines(L)
print (L)
I wrote the above function in Python as I am more familiar with the python language. What it does is searches a 10 by 10 list and if a single row is filled with * then it would delete it and put a new empty row at the top.
I know c does not have the list functions I used. Is there any easy way of going about what I am doing?