SRL Archive - Other Scripts

Downkart!


Markus

2009-06-16 01:21:12

Downkart is a game everyone should have at his/her TI-83/84. The game is really simple: just don't hit the walls!
Because I was bored, I ported this awesome game (including it's aweful bugs + some others -.-) to SCAR!
It's 118 lines of pure fun (original version is 92), and the gameplay is exactly the same as at the calc: use left/right arrow keys, and it saves the highscore ;)
Parts of the original source are in the comments :p
Have fun!
Markus


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.

Shuttleu

2009-06-16 01:26:53

ooo… thank you
i shall now play and see how it is

~shut

senrath

2009-06-16 01:28:52

Dear lord, this is an old game. And yet still so addictive.

Shuttleu

2009-06-16 01:37:30

darn i cant get any better :/
HIGH:1042

~shut

senrath

2009-06-16 01:39:57

From: Shuttleu
darn i cant get any better :/
HIGH:1042

~shut


I beat you by 9 points :P

Runescapian321

2009-06-16 01:47:31

First try: HIGH:1041

Nice Markus :) I've played this on my calc a couple times.

Wow it get's challenging at around 1040

HIGH:1051

Cazax

2009-06-16 01:52:32

HIGH:1067
Sometimes the road completely closes :(

Runescapian321

2009-06-16 01:57:56

^^ Yeah that happened to me a couple times, on the right side.

senrath

2009-06-16 02:06:57

Congrats, you encountered one of the original bugs :P

Da 0wner

2009-06-16 02:25:17

SCORE:1066 ]
HIGH:1066 ]
NEW HIGH SCORE!
]
]
]
] [
] [
Successfully executed
:D.

bullzeye95

2009-06-16 02:51:46

Nofair, my v crashed into a ]
:<

noidea

2009-06-16 05:07:10

Score:1075
high:1075
new high score!

Rubix

2009-06-16 05:16:41

Score:36
high:36
new high score!

quite often it completely closed :(

Da 0wner

2009-06-16 05:19:35

No Rubix, you just suck lol.

Phran6

2009-06-16 05:24:15

ahah owned
SCORE:1077
HIGH:1077
NEW HIGH SCORE!




] [
Successfully executed

noidea

2009-06-16 05:29:59

From: francishelie
ahah owned
SCORE:1077
HIGH:1077
NEW HIGH SCORE!




] [
Successfully executed


Nooo! By two points!

Edit: Beat this!
Look at the attached pic

Dan Cardin

2009-06-16 14:50:04

SCORE:1070]
HIGH:1070
NEW HIGH SCORE!

Thats the best i got. Funly game though.

After playing for a while though, it doesnt look like a road any more, they just kind fo randomly get placed.

EDIT: when it closes up all the way, you can go on the right side wall and not die.

SCORE:1566
HIGH:1566
!

Dervish

2009-06-16 15:28:48

SCORE:1072
HIGH:1072
]
]
]
]
] [
] [
Successfully executed


Wow nice game, just gets too thin passage at times.

Edit : will you make this more illustrated and fix glitches ?

mixster

2009-06-16 16:45:11

ASCII fun, huzzah!
Oh, posting high scores here is fail since everyone knows that everyone else cheat.
(I got 2 points more than the current highest score posted by people, including those after my post but not including my own so as not to encounter an infinite loop).

Da 0wner

2009-06-16 17:09:20

I did not cheat Mixster :<.

Markus

2009-06-16 17:38:10

You guys can't beat my score :p
Anyways, editted the first post with the script (I originally posted it from my PSP, as I had just 2 secs to pastebin the code :p).

Naike

2009-06-16 17:46:38

Markus markus markus….
I had such high thoughts of you ;)

Naice game, got a bit caught up in it last night..

Narcle

2009-06-16 17:46:43

SCORE:1575
HIGH:1575
NEW HIGH SCORE!


Couldn't get any higher. >.>

Blumblebee

2009-06-16 17:56:22

best i could do:

SCORE:1079
HIGH:1079
NEW HIGH SCORE!

ShowerThoughts

2009-06-16 18:10:15

Score:1560
high:1560
new high score!

Dan Cardin

2009-06-16 23:15:27

From: Markus
You guys can't beat my score :p
Anyways, editted the first post with the script (I originally posted it from my PSP, as I had just 2 secs to pastebin the code :p).

well, i am in 3rd now. you then, Narcle, the me.

i just got HIGH:1568. Though i seem to usually stop around 1050. Could you modify it to keep the entire track instead of overwriting it? i think it would be interesting to look at.

ShowerThoughts

2009-06-16 23:20:47

From: Dan Cardin
well, i am in 3rd now. you then, Narcle, the me.

i just got HIGH:1568. Though i seem to usually stop around 1050. Could you modify it to keep the entire track instead of overwriting it? i think it would be interesting to look at.


Cmon you're SRL member you should know how scar works…

Markus

2009-06-16 23:23:52

From: Hermen
Cmon you're SRL member you should know how scar works…

You are too, so you could also do it :p

edit: Here we go!

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(150);
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 ""
Output(GetDebugLineCount-8+8,R,']');
Output(GetDebugLineCount-8+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(GetDebugLineCount-8+4,K,' ');
Output(GetDebugLineCount-8+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(GetDebugLineCount-8+5-X,V-X,'*');
Output(GetDebugLineCount-8+5+X,V+X,'*');
Output(GetDebugLineCount-8+5-X,V+X,'*');
Output(GetDebugLineCount-8+5+X,V-X,'*');
Output(GetDebugLineCount-8+5-X,V,'*');
Output(GetDebugLineCount-8+5+X,V,'*');
Output(GetDebugLineCount-8+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(GetDebugLineCount-8+5-X,V-X,' ');
Output(GetDebugLineCount-8+5+X,V+X,' ');
Output(GetDebugLineCount-8+5-X,V+X,' ');
Output(GetDebugLineCount-8+5+X,V-X,' ');
Output(GetDebugLineCount-8+5-X,V,' ');
Output(GetDebugLineCount-8+5+X,V,' ');
Output(GetDebugLineCount-8+5,V-X,' ');
Output(GetDebugLineCount-8+5,V+X,' ');
wait(50);
X := X + 1;//X+1->X
end; //End
Output(GetDebugLineCount-8+1,1,'SCORE: ');
Output(GetDebugLineCount-8+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(GetDebugLineCount-8+3,1,'NEW HIGH SCORE!');
End;
Output(GetDebugLineCount-8+1,7,inttostr(S));
Output(GetDebugLineCount-8+2,6,inttostr(hiscore));
//Pause
end.

Cazax

2009-06-16 23:36:40

SCORE:1596
The road was tiny :(
EDIT: SCORE:1597

senrath

2009-06-16 23:59:45

Woo!

SCORE:2081
HIGH:2081

noidea

2009-06-17 00:12:07

Score:1590
high:1590
new high score!

Dan Cardin

2009-06-17 06:12:57

From: Hermen
Cmon you're SRL member you should know how scar works…

It doesnt mean that i can automatically understand the logic of everything done. And ive never had to use the debugbox for anything other than writeln, so i wouldnt know how to do that either.

RACE
+-+
!*! READY
!*! SET
!*! GO
+-+v


] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
SCORE:1598[
HIGH:1598 [
NEW HIGH SCORE!
[
[
[
[
] [
Successfully executed

RACE
+-+
!*! READY
!*! SET
!*! GO
+-+v


] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
SCORE:2084 [
HIGH:2084 [
NEW HIGH SCORE!
]
]
]
] [
] [
Successfully executed

ian.

2009-06-17 06:19:57

AHHAHAH! While I was playing the news downloaded and I was like WTFROADBLOCK! D: haha it made me lol ^^

Blumblebee

2009-06-17 07:33:34

RACE
+-+
!*! READY
!*! SET
!*! GO
+-+v


] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
] [
SCORE:2080 ] [
HIGH:2080 ] [
NEW HIGH SCORE!
[
[
[
[
] [
Successfully executed

no big deal….

Harry

2009-06-17 09:11:10

SCORE:-1073087114
HIGH:1696951930

I didn't edit some of the vars, honest D:
I am just a sick gamer.

Markus

2009-06-17 15:28:00

From: Harry
I didn't edit some of the vars, honest D:
I am just a sick gamer.

Na, that would take you at least 20 years to achieve unless you hacked the time etc. in which case it isnt humanly possible to get such a score :p

Xanith

2009-06-17 23:54:25

SCORE:1566
HIGH:1566
NEW HIGH SCORE!



Most addicting game ever.

HyperSecret

2009-06-18 05:33:48

SCORE:2082
HIGH:2082
NEW HIGH SCORE!
] [
]
]
[
] [
Successfully executed