Показать сообщение отдельно
Старый 22.11.2007, 08:42   #11
odd
Мастер
 
Аватар для odd
 
Регистрация: 06.09.2007
Адрес: Донецк, ДНР
Сообщений: 1,023
Написано 298 полезных сообщений
(для 713 пользователей)
Re: Brainfuck интерпретатор (помогите с меню)

Немного изменил процедуру info и меню стало нормально вызываться и тормоза исчезли. Попоробуй.

 
procedure info();
var GKey:integer;
begin
Gkey:=KE_NONE;
while GKey <> KE_KEY5 do
begin
 clicked:= getClickedCommand; GKey:=getKeyClicked;
 if GKey=KE_KEY1 then begin z:=z+1; i:=i+1; readInfo('.',z,i); end;
 if GKey=KE_KEY2 then begin z:=z+1; i:=i+1; readInfo('+',z,i); end;
 if GKey=KE_KEY3 then begin z:=z+1; i:=i+1; readInfo(',',z,i); end;
 if GKey=KE_KEY4 then begin z:=z+1; i:=i+1; readInfo('<',z,i); end;
 if GKey=KE_KEY6 then begin z:=z+1; i:=i+1; readInfo('>',z,i); end;
 if GKey=KE_KEY7 then begin z:=z+1; i:=i+1; readInfo('[',z,i); end;
 if GKey=KE_KEY8 then begin z:=z+1; i:=i+1; readInfo('-',z,i); end;
 if GKey=KE_KEY9 then begin z:=z+1; i:=i+1; readInfo(']',z,i); end;
 if GKey=KE_KEY0 then begin if i>0 then begin z:=z-1; i:=i-1; if i<=0 then i:=0; if z<=0 then z:=0; readInfo('0',z,i); end; end;
 if (GKey=KE_STAR) and (vector=1) then begin i:=i-trunc(shir/getStringWidth('-.'))+1; if i<=0 then i:=0; readInfo('',z,i); end;
 if (GKey=KE_POUND) and (vector=1) then begin i:=i+trunc(shir/getStringWidth('-.'))-1; if i>=999 then i:=999; if stroka[i+1]='' then i:=z; readInfo('1',z,i); end;
 if (GKey=KE_STAR) and (vector=0)  then begin i:=i-1; if i<=0 then i:=0; readinfo('',z,i); end;
 if (GKey=KE_POUND)  and (vector=0) then begin i:=i+1; if i>=999 then i:=999; if stroka[i+1]='' then i:=z; readInfo('1',z,i); end;
 if clicked=moveC then adzac;    
 if clicked=menuC then menu; 
    end;
    clrscr; go(0,0,0);
  end;
(Offline)
 
Ответить с цитированием