hmm.. are you shure that there is no need to call testnumber twice? When I tried to do this soome days ago, there was lost of some repositions, which is of course not acceptable...Because now, there's just one call of TESTNUMBER, replace it by inserting the TESTNUMBER Code directly so you save the call.
upper testnumber called much more rarely then lower, but if not use it at all, we lost some repositions....
this is a code, in which permuteall called:
procedure calculate(ttn:numb); Var i,j,use_zero:byte; begin PermuteAll(ttn,dlina); if xit=true then exit; while (true) do begin i:=dlina; while (i>0) and (ttn[i]=MaxSgn-dlina+i) do Dec(i); if i=0 then begin tm2:=timerticks;writeln('your answers were'); writeln('wrong! (',((tm2-tm1)/50):4:2,'s) '); gotoxy(0,7); write('[EXE] - back to menu'); repeat until readkey=ckey_exe; setcrtvisualpage(0); setcrtactivepage(0); exit;end; Inc(ttn[i]); for j:=i+1 to dlina do ttn[j]:=ttn[j-1]+1; PermuteAll(ttn,dlina); if xit=true then begin setcrtvisualpage(0);setcrtactivepage(0);exit;end; end; end;