!set n=$teller
!if $graad=0
    R=$teller
!else
    R=$graad
!endif        
plaatje=0
varlist=$empty
arglist=$empty
varcnt=0
woordmax=40
complex=1
somtekst$n=!record 1 of lang/remarks.$taal
bewerking=common/number.proc
keuze=!randitem 1,0
!if $R=1
    !if $keuze=1
	b=!randitem 2,3,4,5,6,7,8,9
    	a=$[$b*$b]
	GOED$n=$b*i,-1*$b*i
	goed$n= z\,\,=\, \pm $b \cdot i
    !else
	a=!randitem 2,3,5,6,7,10,11,13,14,15,17,19
	GOED$n=sqrt($a)*i,-1*sqrt($a)*i
	goed$n= z\,\,=\, \pm \sqrt{$a}\cdot i
    !endif
    opgave$n= z^{2}\,\,=\,\, - $a
 !exit
!endif

!if $R=2
    a=!randitem 2,3,4,5,6,7,8,9
    b=$[$a*$a]
    k=!randitem 2,3,4,5	
    c=$[$b*$k]
    GOED$n=$a*sqrt($k)*i,$[-1*$a]*sqrt($k)*i
    opgave$n=z^{2}\,\,=\,\,$[-1*$c]
    goed$n=\left[ \begin{array}{l}$c = $b \cdot $k = $a \cdot $a \cdot $k \rightarrow \sqrt{$c} = $a \cdot \sqrt{$k} \\ \\  z= \pm $a\cdot \sqrt{$k}\cdot i 
 !exit
!endif

!if $R>2
    tot=!recordcnt nivo/data1
    rec=!randint 1,$tot
    rec=!record $rec of nivo/data1
    a=!item 1 of $rec
    b=!item 2 of $rec
    c=!item 2 of $rec
    GOED$n=$b,-1*$b
    goed$n=!texmath $c
    goed$n=z\,\,=\,\pm $(goed$n)
    a=!texmath $a
    opgave$n=z^{2}\,\,=\,- $a     	
 !exit
!endif
