Changeset 8
- Timestamp:
- Feb 9, 2012, 3:48:16 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LazFuckIDE.lpi
r4 r8 7 7 <SessionStorage Value="InProjectDir"/> 8 8 <MainUnit Value="0"/> 9 <Title Value=" project1"/>9 <Title Value="LazFuck"/> 10 10 <ResourceType Value="res"/> 11 11 <UseXPManifest Value="True"/> -
trunk/LazFuckIDE.lpr
r4 r8 14 14 15 15 begin 16 Application.Title:='LazFuck'; 16 17 RequireDerivedFormResource := True; 17 18 Application.Initialize; -
trunk/UBrainFuck.pas
r7 r8 76 76 begin 77 77 repeat 78 while Parent.SourcePosition < Length(Parent.Source) do begin78 while (Parent.SourcePosition < Length(Parent.Source)) and (Parent.State <> rsStopped) do begin 79 79 Parent.SingleStep; 80 80 while Parent.State = rsPaused do begin … … 83 83 end; 84 84 Parent.SetState(rsStopped); 85 until Terminated ;85 until Terminated or (Parent.State = rsStopped); 86 86 end; 87 87 … … 101 101 102 102 function TBrainFuckInterpretter.Read: Byte; 103 var104 Character: string;105 103 begin 106 104 while InputPosition >= Length(Input) do begin 107 105 Sleep(1); 108 Application.ProcessMessages; 109 end; 110 Character := Copy(Input, InputPosition, 1); 111 Result := Ord(Character[1]); 106 end; 107 Result := Ord(Input[InputPosition + 1]); 112 108 Inc(InputPosition); 113 109 end; 114 110 115 111 function TBrainFuckInterpretter.ReadCode: Char; 116 var 117 Code: string; 118 begin 119 Code := Copy(Source, SourcePosition + 1, 1); 120 Result := Code[1]; 112 begin 113 Result := Source[SourcePosition + 1] 121 114 end; 122 115 … … 156 149 begin 157 150 case ReadCode of 158 '>': Inc(MemoryPosition); 151 '>': if MemoryPosition < Length(Memory) then Inc(MemoryPosition) 152 else raise Exception.Create(SProgramUpperLimit); 159 153 '<': if MemoryPosition > 0 then Dec(MemoryPosition) 160 154 else raise Exception.Create(SProgramLowerLimit); … … 199 193 SetState(rsRunning); 200 194 Reset; 195 SetThread(False); 201 196 SetThread(True); 202 197 end; -
trunk/UInterpreterForm.lfm
r6 r8 34 34 Width = 309 35 35 Anchors = [akTop, akLeft, akRight, akBottom] 36 Font.Name = 'Courier New' 36 37 OnKeyPress = MemoInputKeyPress 38 ParentFont = False 37 39 ScrollBars = ssAutoBoth 38 40 TabOrder = 0 … … 80 82 Width = 309 81 83 Anchors = [akTop, akLeft, akRight, akBottom] 84 Font.Name = 'Courier New' 85 ParentFont = False 82 86 ScrollBars = ssAutoBoth 83 87 TabOrder = 0
Note:
See TracChangeset
for help on using the changeset viewer.