:start
!if $sign=0
samesign=$charges
!else
samesign=!randint 1,$charges
!endif
xs=!shuffle $[2*$xy_size-1]
ys=!shuffle $[2*$xy_size-1]

!if $sign=0
!for i=1 to $charges
a$(i)=!item $i of $xs
a$i=$[$(a$(i))-$xy_size]
b$(i)=!item $i of $ys
b$i=$[$(b$(i))-$xy_size]
d=!randint 1,8
c=!randitem -1,1
q$(i)=$[($d)*($c)]
xyq=!append line $(a$(i)),$(b$(i)),$(q$(i))  to $xyq
!next i

!else
!for i=1 to $samesign
a$(i)=!item $i of $xs
a$i=$[$(a$(i))-$xy_size]
b$(i)=!item $i of $ys
b$i=$[$(b$(i))-$xy_size]
d=!randint 1,8
q$(i)=$[($d)*($sign)]
xyq=!append line $(a$(i)),$(b$(i)),$(q$(i))  to $xyq
!next i

!for i=$[$samesign+1] to $charges
a$(i)=!item $i of $xs
a$i=$[$(a$(i))-$xy_size]
b$(i)=!item $i of $ys
b$i=$[$(b$(i))-$xy_size]
d=!randint 1,8
q$(i)=$[-($d)*($sign)]
xyq=!append line $(a$(i)),$(b$(i)),$(q$(i))  to $xyq
!next i
!endif

f=0
g=0
!for i=1 to $charges
R$(i)=(x-($(a$(i))))^2+(y-($(b$(i))))^2
S$(i)=($(R$(i)))^(3/2)
f=$f+($(q$(i)))*(x-($(a$(i))))/($(S$(i)))
g=$g+($(q$(i)))*(y-($(b$(i))))/($(S$(i)))
!next i

liste=$f,$g
