SCAR Code:
program TIDOwnKart;
function putstuffinstring(pos : integer; soi, insert : string) : string; //Function to mimic 'Output', not exactly the same oh well it works :)
begin
pos := max(0, pos);
result := copy(soi, 1,pos-1)+insert+copy(soi, length(insert)+pos, length(soi)-length(insert)-pos);
end;
procedure output(y,x : integer; s : string);
begin dec(y);
replacedebugline(y, putstuffinstring(x, getdebugline(y), s));
end;
var c, b, d, a, l, n, r, v, k, o, p,x,s,hiscore : integer;
begin
ClearDebug; //ClrHome
writeln('RACE'); writeln('+-+'); writeln('! !'); writeln('! !'); writeln('! !'); writeln('+-+');//Disp "RACE","+-+","! !","! !","! !","+-+"
wait(300);//For(Á,1,100
//End
ReplaceDebugLine(2, putstuffinstring(2, getdebugline(3), '*! READY')); //Output(3,2,"*! READY"
wait(300);{ForÁ,1,100
End}
ReplaceDebugLine(3, putstuffinstring(2, getdebugline(4), '*! SET')); //Output(4,2,"*! SET"
wait(300);//For(Á,1,100
//End
hiscore := StrToIntDef(loadsetting('downkart', 'hiscore'), 0);
ReplaceDebugLine(4, putstuffinstring(2, getdebugline(3), '*! GO')); //Output(5,2,"ô! GO"
c := 5; //5->C
B := 5; //5->B
A := 5; //5->A
L := 0; //0->L
N := 0; //0->N
R := 5; //5->R
V := 8; //8->V
K := 8; //8->K
O := 7; //7->O
P := 1; //1->P
writeln(' '); writeln(' '); //This is to mimic the 8 lines the TI has
While true do
begin //While 1
wait(100);
R := R + RandomRange(-1, 2); //R+randInt(-1,1)->R
If r=2 then//If R=2
r := 3;//3->R
If 3 = 9 then//If R=9
r := 8; //8->R
writeln(' '); DeleteDebugLine(0);//Disp ""
ReplaceDebugLine(7, putstuffinstring(R, getdebugline(7), ']'));//Output(8,R,"]"
ReplaceDebugLine(7, putstuffinstring(R+O, getdebugline(7), '['));//Output(8,R+O,"["
//getKey->Y
if IsArrowDown(3) then //If Y=24
v := V-1; //V-1->V
if isarrowdown(1) then //If Y=26
V := V+1; //V+1->V
//If Y=21 //Fckn gaypause duh
//Pause
Output(4,K,' ');
Output(5,V,'v');
K := V; //V->K
If (V<=C) or (V>=C+O) then //If V=<C or V>=C+O
break;//Goto C
D := C; //C->D
C := B; //B->C
B := A; //A->B
A := R; //R->A
N := N+1;//N+1->N
If N>= 40 then//If N>=40
begin //Then
O := O-P;// O-P->O
N := 0; //0->N
L := L+4; //L+4->L
end; //End
If O <= 2 then //If O=<2
//0->P
P := 0;
End;
//KO: //Lbl C
//0->X
while (x<=2) do //While X=<2
begin
//writeln('UR DEAD');
//break;
//end;
Output(5-X,V-X,'*');
Output(5+X,V+X,'*');
Output(5-X,V+X,'*');
Output(5+X,V-X,'*');
Output(5-X,V,'*');
Output(5+X,V,'*');
Output(5,V-X,'*');
wait(75);
//Output(5,V+X,"*"
X := X+1;//X+1->X
end;//End
x := 0;//0->X
while x <= 2 do
begin //While X=<2
Output(5-X,V-X,' ');
Output(5+X,V+X,' ');
Output(5-X,V+X,' ');
Output(5+X,V-X,' ');
Output(5-X,V,' ');
Output(5+X,V,' ');
Output(5,V-X,' ');
Output(5,V+X,' ');
wait(50);
X := X + 1;//X+1->X
end; //End
Output(1,1,'SCORE: ');
Output(2,1,'HIGH: ');
S := L*130+N; //L*130+N->S
If S>hiscore
Then begin
hiscore := s;
SaveSetting('downkart', 'hiscore', inttostr(s)); //S->ZTmax
Output(3,1,'NEW HIGH SCORE!');
End;
Output(1,7,inttostr(S));
Output(2,6,inttostr(hiscore));
//Pause
end.