Skip to content

Instantly share code, notes, and snippets.

@freeonterminate
Created January 9, 2014 13:45
Show Gist options
  • Save freeonterminate/8334291 to your computer and use it in GitHub Desktop.
Save freeonterminate/8334291 to your computer and use it in GitHub Desktop.
くおえうえーーーるえうおおおwww
program QuoeeeeUeuooowww;
const
MEM_SIZE = 1024;
MEM_HIGH = MEM_SIZE - 1;
CMD_NEXT = 'く'; //'>';
CMD_PREV = 'う'; //'<';
CMD_INC = 'w'; //'+';
CMD_DEC = 'お'; //'-';
CMD_OUTPUT = 'ー'; //'.';
CMD_INPUT = 'る'; //',';
CMD_WHILE_BEGIN = 'え'; //'[';
CMD_WHILE_END = 'ぇ'; //']';
type
PMemory = ^TMemory;
TMemory = array [0..MEM_HIGH] of Char;
var
Cs: String;
C: Char;
Mem: PMemory;
Ptr: Integer;
Hi: Integer;
Len: Integer;
i: Integer;
procedure WhileProc(const S, E: Integer; const P, Q: Char);
const
DIR: array [Boolean] of Integer = (-1, +1);
var
j: Integer;
D: Integer;
Count: Integer;
begin
j := S;
D := DIR[E > S];
Count := 0;
while (j <> E) do begin
C := Cs[j];
if (C = P) then begin
Dec(Count);
if (Count < 1) then begin
i := j - 1;
Break;
end;
end;
if (C = Q) then
Inc(Count);
Inc(j, D);
end;
end;
begin
New(Mem);
Cs := ParamStr(1);
Len := Length(Cs);
Hi := Length(Cs) - 1;
Ptr := 0;
i := 1;
while (i < Len) do begin
case Cs[i] of
CMD_NEXT: begin
Inc(Ptr);
if (Ptr > MEM_HIGH) then
Ptr := MEM_HIGH;
end;
CMD_PREV: begin
Dec(Ptr);
if (Ptr < 0) then
Ptr := 0;
end;
CMD_INC: begin
Inc(Mem [Ptr]);
end;
CMD_DEC: begin
Dec(Mem [Ptr]);
end;
CMD_OUTPUT: begin
Write(Mem [Ptr]);
end;
CMD_INPUT: begin
Read(C);
Mem [Ptr] := C;
end;
CMD_WHILE_BEGIN: begin
if (Mem [Ptr] = #0) then
WhileProc(i, Hi, CMD_WHILE_END, CMD_WHILE_BEGIN);
end;
CMD_WHILE_END: begin
if (Mem [Ptr] <> #0) then
WhileProc(i, 1, CMD_WHILE_BEGIN, CMD_WHILE_END);
end;
end;
Inc(i);
end;
Dispose(Mem);
Writeln;
Readln;
end.
@freeonterminate
Copy link
Author

wwwwwwwwwえくwwwwwwwwくwwwwwwwwwwwくwwwwwうううおぇくーくwwーwwwwwwwーーwwwーくおーおおおおおおおおおおおおーうwwwwwwwwーおおおおおおおおーwwwーおおおおおおーおおおおおおおおーくwー

Hello, world

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment