pyB 
flag = 0
while not flag:
    flag = 1
    varx = 1.0*int( 12*random.random()-6 )
    vary = 1.0*int( 12*random.random()-6 )
    varz = 1.0*int( 12*random.random()-6 )
    if varx:
	if (not vary) and (not varz): 
            flag = 0
    else:
        if (not vary) or (not varz):
            flag = 0

rstr = vecstring( varx, vary, varz )
flag = 0
while not flag:
    flag = 1
    arx = 1.0*int( 12*random.random()-6 )
    ary = 1.0*int( 12*random.random()-6 )
    arz = 1.0*int( 12*random.random()-6 )
    if arx:
	if (not ary) and (not arz): 
            flag = 0
    else:
        if (not ary) or (not arz):
            flag = 0

qstr = vecstring( arx, ary, arz )
cx = varx+arx
cy = vary+ary
cz = varz+arz
sumv = vecstring( cx, cy, cz )
thecorrect = [sumv]
la = [vecstring(cx+1,cy,cz),vecstring(cx,cy+1,cz),vecstring(cx,cy,cz+1)]
lb = [vecstring(cx+2,cy,cz),vecstring(cx,cy+2,cz),vecstring(cx,cy,cz+2)]
lc = [vecstring(cx-1,cy,cz),vecstring(cx,cy-1,cz),vecstring(cx,cy,cz-1)]
ld = [vecstring(cx-2,cy,cz),vecstring(cx,cy-2,cz),vecstring(cx,cy,cz-2)]
incorrects = collectio( la+lb+lc+ld, 3 )
subst = thecorrect+incorrects
unsorted = shuffle( subst )
certa[0] = unsorted[0]
opts = unsorted[1]
emit( """A soma do vector $\\vec{r}=%s$ com o vector $\\vec{q}=%s$ : 
\\begin{enumerate}""" % (rstr,qstr) )
for i in opts:
    emit( "\n\\item ", "$\\vec{r}+\\vec{q}=%s$" % i )
pyE
\end{enumerate}