Note that there are some explanatory texts on larger screens.

plurals
  1. PONested lists references not working
    text
    copied!<p>I'm a noob in middle school. I have a short piece of code that isn't working:</p> <pre><code>board=[] temp=[] for var0 in range(17): temp.append(' ') for var in range(17): board.append(temp) class group: def __init__(self): self.f=[] self.x=[] self.y=[] groupb=[] groupw=[] while 1: for var0 in range(17): for var1 in range(17): if var1==16: print((board[var0])[16]) else: print((board[var0])[var1],end='') move=input() move=(move.lower()).split() move[1]=int(move[1]) move[2]=int(move[2]) if move[0]=='b': board[move[1]][move[2]]=' b' for var0 in range(len(groupb)): if (move[1]-1 in groupb[var0].x or move[1]+1 in groupb[var0].x or move[1] in groupb[var0].x) and (move[2]-1 in groupb[var0].y or move[2]+1 in groupb[var0].y or move[2] in groupb[var0].y): (groupb[var0].x).append(move[1]) (groupb[var0].y).append(move[2]) temp=1 if temp!=1: groupb.append('') groupb[len(groupb)-1]=group() elif move[0]=='w': board[move[1]][move[2]]=' w' for var0 in range(len(groupw)): if (move[1]-1 in groupw[var0].x or move[1]+1 in groupw[var0].x or move[1] in groupw[var0].x) and (move[2]-1 in groupw[var0].y or move[2]+1 in groupw[var0].y or move[2] in groupw[var0].y): (groupw[var0].x).append(move[1]) (groupw[var0].y).append(move[2]) if temp!=1: groupw.append('') groupw[len(groupb)-1]=group() else: print('TurnError') </code></pre> <p>But every time I try to run it, it spits out an entire column when I only want a single character:</p> <pre><code> b b b b b b b b b b b b b b b b b </code></pre> <p>Can anybody tell me what I'm doing wrong? I'm really confused.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload