Adventure Game with text input

A forum where you can announce your awesome project(s).

Moderator: MaxCoderz Staff

Would you play an adventure game where you have to type two word input?

yes
10
71%
no
4
29%
 
Total votes: 14

DarkerLine
Calc Wizard
Posts: 526
Joined: Tue 08 Mar, 2005 1:37 am
Location: who wants to know?
Contact:

Post by DarkerLine »

Unless you found a way of compressing it. For example, replacing all zeroes with negative of the amount of zeroes. {4,3,2,0,0,0} would become {4,3,2,-3

To decompress it:

1->I
For(A,1,8
For(B,1,12 //A and B are row, column of the matrix, change the numbers accordingly
I+not(L1(I -> I
L1(I
If 0<Ans:Then
IS>(I,e3
Ans->[A](A,B
Else
Ans+1->L1(I
0->[A](A,B
End
End
End
just try to be nice to people.
_________________
My TI Blog - http://mpl.unitedti.org/
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post by kalan_vod »

Yes thats what I was thinking of how to compress, nice work.
CompWiz
Calc King
Posts: 1950
Joined: Thu 13 Oct, 2005 1:54 pm
Location: UB

Post by CompWiz »

DarkerLine wrote:Unless you found a way of compressing it. For example, replacing all zeroes with negative of the amount of zeroes. {4,3,2,0,0,0} would become {4,3,2,-3

To decompress it:

1->I
For(A,1,8
For(B,1,12 //A and B are row, column of the matrix, change the numbers accordingly
I+not(L1(I -> I
L1(I
If 0<Ans:Then
IS>(I,e3
Ans->[A](A,B
Else
Ans+1->L1(I
0->[A](A,B
End
End
End
So, I'd just put it into L1, then run this? Just so you know, the matrix will be 6x20.

so would that make it

Code: Select all

1->I
For(A,1,6
For(B,1,20 //A and B are row, column of the matrix, change the numbers accordingly
I+not(L1(I -> I
L1(I
If 0<Ans:Then
IS>(I,e3
Ans->[A](A,B
Else
Ans+1->L1(I
0->[A](A,B
End
End
End

Also, when there is only 1 zero, should I put -1 or 0 in the compressed form?


compressed form:

Code: Select all

{4,3,2,-6,1,-2,1,-6,1,0,5,-4,4,-3,9,7,-4,6,-10,7,0,6,10,-3,11,-2,9,-3,10,0,12,-4,11,-9,15,-5,16,14,-4,128,15,-8,18,-6,17,-5,8->L1
Is it right like that, with the single 0's staying as zero?
In Memory of the Maxcoderz Trophy Image
CompWiz
Calc King
Posts: 1950
Joined: Thu 13 Oct, 2005 1:54 pm
Location: UB

Post by CompWiz »

BASIC Code wrote::{19,6}Imagedim([A]
:{4,3,2,(-)6,1,(-)2,1,(-)6,1,0,5,(-)4,4,(-)3,9,7,(-)4,6,(-)10,7,0,6,10,(-)3,11,(-)2,9,(-)3,10,0,12,(-)4,11,(-)9,15,(-)5,16,14,(-)4,128,15,(-)8,18,(-)6,17,(-)5,8ImageL1
:1ImageI
:For(A,1,19
:For(B,1,6
:I+not(L1(IImageI
:L1(I
:If 0<Ans:Then
:IS>(I,e3
:AnsImage[A](A,B
:Else
:Ans+1ImageL1(I
:0Image[A](A,B
:End
:End
:End
Generated by SourceCoder, © 2005 Cemetech
For some reason, this is not working. It gives me an Invalid dim error on the line that says

Code: Select all

I+not(L1ÂÂÂ
In Memory of the Maxcoderz Trophy Image
necro
Calc King
Posts: 1619
Joined: Sat 26 Mar, 2005 2:45 am
Location: your shadow

Post by necro »

INVALID DIM:
you tried to put data into a non-existant var,tried to put data into a var and put it out side of the data range it was made to hold, you tried to read data that is out side the bounds of the variable, or you tried to load data improperly from a var

you need to specify which list element: L1(Var) as opposed to L1
CompWiz
Calc King
Posts: 1950
Joined: Thu 13 Oct, 2005 1:54 pm
Location: UB

Post by CompWiz »

That code that DarkerLine posted seems to be wrong. I'm guessing the I value it is using is too high. Does anyone know why you are adding I and the value at position I of L1 and storing it as I? I don't follow what that's supposed to do. In any case, it's not working.
In Memory of the Maxcoderz Trophy Image
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post by kalan_vod »

:{19,6}dim([A]
You have it reversed?
:{6,19}dim([A]
You wanted a 6x20 you said?
CompWiz
Calc King
Posts: 1950
Joined: Thu 13 Oct, 2005 1:54 pm
Location: UB

Post by CompWiz »

6 across by 19 down. Sorry, the book I am getting this from is confusing. Any idea how to make the decompressing code work?
In Memory of the Maxcoderz Trophy Image
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post by kalan_vod »

Ok I played with making a compression method today and this is what I got:
:{L1(1),L1(2Imagedim([A]:2ImageX
:For(A,1,L1(1
:1ImageB
:Repeat B>L1(2
:X+1ImageX
:If L1(X)Imageabs(L1(X:Then
:For(W,1,abs(L1(X
:L1(X+1Image[A](A,B
:B+1ImageB
:End
:X+1ImageX
:Else
:L1(XImage[A](A,B
:B+1ImageB
:End
:End
:End
In regards to space save within a program
-prgm with the matrix

Code: Select all

[[1,1,1,10,10,10,10,10,10,1,1,1]
[1,40,1,1,1,1,1,10,10,1,40,1]
[1,40,40,40,40,40,1,1,1,1,40,1]
[1,40,40,38,40,7,40,40,7,40,40,1]
[1,40,40,40,7,40,40,40,7,40,40,1]
[1,40,1,1,1,40,1,1,1,1,40,1]
[1,1,1,10,1,1,1,10,10,1,40,1]
[10,10,10,10,10,10,10,10,10,1,39,1
-prgm with the compressed list

Code: Select all

{8,12,(-)3,1,(-)6,10,(-)3,1,1,40,(-)5,1,(-)2,10,1,40,1,1,(-)5,40,(-)4,1,40,1,1,(-)2,40,38,40,7,(-)2,40,7,(-)2,40,1,1,(-)3,40,7,(-)3,40,7,(-)2,40,1,1,40,(-)3,1,40,(-)4,1,40,1,(-)3,1,10,(-)3,1,(-)2,10,1,40,1,(-)9,10,1,39,1
saved 67 bytes with the compressed list
The way the code works here is
-L1(1) and L1(2) = the diminsions of the matrix
-Then on L1(3) is the first number, but since its a neg. number it is then interperated as a sign of how many times the following number will be used. So -3,1 would be 1,1,1. And if there isn't a neg. number then it will just list that number there in the appropiate [A](A,B.
-The only limitaion this routine has is, lets say the first row of a 8x12 matrix is all 1s, but the second rows first number is a 1 also. We can't make it -13,1. So we have to make it -12,1,1,etc...

Now this is with just one of my levels for Res, so the compression can be very space saving.
Just one thing you have to consider though. What is more important in your program:
-Size or Speed?
Image
or
Image

Let me know if you don't understand something or if you think this is good or bad :D. Also whats you opion of speed or size.
Edit: I realize there are a few ops. that can be added so if you have a addition let me know.
Edit Edit: If L1(X)Imageabs(L1(X:Then
can be changed into
If not(L1(X
Spengo
Calc Master
Posts: 1116
Joined: Sat 15 Jan, 2005 3:56 am
Location: ooga booga land
Contact:

Post by Spengo »

I'd say speed definitely. The 83+ regular runs many basic games rather slowly. Size doesn't matter too much 'cause there's always the archive. :)
bananas... o.o
User avatar
L4E_WakaMol-King
Maxcoderz Staff
Posts: 342
Joined: Tue 01 Nov, 2005 6:34 am

Post by L4E_WakaMol-King »

I agree with Spengo... go with speed over size. The only problem you might run into there is getting stuff from the archive. Will there be a routine to do this or will the user have to unarchive things? Or will the program just fit in ram?

Btw, nice BASIC compression routine. :D
Image - Now Under Development - [Progress]
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post by kalan_vod »

Weeeeee, thanks for the input, but I decided for myself also that I'd rather a bigger program than a smaller/takes long time to load!
CompWiz
Calc King
Posts: 1950
Joined: Thu 13 Oct, 2005 1:54 pm
Location: UB

Post by CompWiz »

For getting stuff out of ram, I was thinking about using Flash Gordon. And for these loading up the matrix things, I was actually hoping to optimize for size. They only run once, and as long as they only take a few seconds, that would be OK.

As for the compression routine, The data I am using has no repeating digits other than zero. However, there are alot of repeating zeros. Therefore, I think that the idea DarkerLine had to represent the amount of zeros with negative numbers is the best. For some reason, his code isn't working though. :(

His code with my data:
BASIC Code wrote::{19,6}Imagedim([A]
:{4,3,2,(-)6,1,(-)2,1,(-)6,1,0,5,(-)4,4,(-)3,9,7,(-)4,6,(-)10,7,0,6,10,(-)3,11,(-)2,9,(-)3,10,0,12,(-)4,11,(-)9,15,(-)5,16,14,(-)4,128,15,(-)8,18,(-)6,17,(-)5,8ImageL1
:1ImageI
:For(A,1,19
:For(B,1,6
:I+not(L1(IImageI
:L1(I
:If 0<Ans:Then
:IS>(I,e3
:AnsImage[A](A,B
:Else
:Ans+1ImageL1(I
:0Image[A](A,B
:End
:End
:End
Generated by SourceCoder, © 2005 Cemetech
In Memory of the Maxcoderz Trophy Image
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post by kalan_vod »

Well his is a little more complex :? , so I will edit mine to make it only concern 0's and that isn't really hard at all, but I am busy atm so I'll have to do it later.
threefingeredguy
Calc King
Posts: 2195
Joined: Sun 27 Mar, 2005 4:06 am
Location: sleeping
Contact:

Post by threefingeredguy »

Code: Select all

:{19,6}->dim([A] 
:{4,3,2,(-)6,1,(-)2,1,(-)6,1,0,5,(-)4,4,(-)3,9,7,(-)4,6,(-)10,7,0,6,10,(-)3,11,(-)2,9,(-)3,10,0,12,(-)4,11,(-)9,15,(-)5,16,14,(-)4,128,15,(-)8,18,(-)6,17,(-)5,8}->L1 
:For(A,1,dim(L1
:If L1(A)<0
:Then
:For(B,1,-L1(A)
:0->[A](int(A/6),A-int(A/6)
:End
:Else
:L1(A->[A](int(A/6),A-int(A/6)
:End
:End
Image
Post Reply