this is good. right?
;newpiece is the piece that was just played
For dir=0 To 7
x=newpiecex
y=newpiecey
amount=1
Repeat
x=x+Ceil(Cos(dir*45))
y=y+Ceil(Sin(dir*45))
If grid(x,y)<>newpieceteam Then Exit
amount=amount+1
If amount=4 Then RuntimeError "FOUR!"
Forever
Next