My best guess is this bit of code:
for i, circle in pairs( tCircles ) do
--Snip--
if circle.r > ( maxx / 2 ) then
table.remove( tCircles, i ) --#This
end
end
From what i can tell, it probably won't like you removing a circle while you're looking at them all…
Best solution would probably be to do this:
local cDelete = {}
for i, circle in pairs( tCircles ) do
local t = tWindows[ circle.parent ]
local maxx, maxy = t.getSize()
term.redirect( t )
--[[
for x = 1, maxx, 0.75 / circle.r do
local y1, y2 = getY( circle.x, circle.y, circle.r, x )
t.setCursorPos( x, y1 )
t.write( " " )
t.setCursorPos( x, y2 )
t.write( " " )
end
]]--
drawCircle( circle.x, circle.y, circle.r, colors.blue, false )
circle.r = circle.r + 1
if circle.r > ( maxx / 2 ) then
table.insert( cDelete, i )
end
end
for _,del in pairs( cDelete ) do
tCircles[del] = nil
end
Edit: After actually testing the code with my solution i can safely say, I AM RIGHT! IT WORKS! MWAHAHAHAHHA
Edit2: After testing more, it seems that after a while it throws a java exception… I'll find the cause
Edit3: Testing even more, i cannot reproduce the damn java exception, WHY MUST THIS PROGRAM TOY WITH ME!