Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => Topic started by: _player1537 on July 25, 2010, 10:03:35 pm

Title: Answer Programs
Post by: _player1537 on July 25, 2010, 10:03:35 pm
I got kinda bored one day, with the lack of ideas for programs/games to make, so I started writing stuff in Basic using only the answer variable.  I ended up with one (finished) game, boulder dodge (aka ZZZZZ.8xp), and a game I was going to make kinda like elmgon (the engine that is, which isn't quite finished).  I haven't really done too many projects lately I've noticed... so here they are ^^

ZZZZZ.8xp - Boulder dodge, use the arrow keys to move, and avoid the "*".  It uses the list "ZHIGH" to store the highscore

ZZZZ.8xp - The elmgon "clone"?, use arrow keys to move, up to jump, and press alpha then an arrow key to shoot a laser (Not finished D:).  I plan to add more and finish it soon.
ZZZGTMAP.8xp - a major slowdown in my code, checks for a collision for the lasers
ZZZMAPS.8xp - contains the maps for the program

Note:  I cheated a little bit in the elmgon "clone", it uses for() loops to initilize variables, but it keeps answer in tact throughout the program ^^.  Oh, and I call it an elmgon "clone" because it was just inspired by it, its not meant to cause competition, I was just bored and loved the way you moved around in elmgon.
Title: Re: Answer Programs
Post by: yunhua98 on July 25, 2010, 10:06:57 pm
nice.
i think I might make a asteroids answer game tonight and post it here tommorow.  :P
Title: Re: Answer Programs
Post by: _player1537 on July 25, 2010, 10:10:13 pm
will it use the graph screen?  Oh, and I just remembered a mouse routine I made that only touched answer, I'll upload in a second
Title: Re: Answer Programs
Post by: yunhua98 on July 25, 2010, 10:11:57 pm
nah, it'll use the homescreen, and have it scroll up with Disp"
Just out of curiosity, why do you ask?
Title: Re: Answer Programs
Post by: _player1537 on July 25, 2010, 10:17:56 pm
When you said asteroids, I thought of this: http://www.ticalc.org/archives/files/fileinfo/215/21592.html
I may try and asteroids for the graphscreen with only answer, sounds fun ^^  But it will probably be crazy slow
Title: Re: Answer Programs
Post by: yunhua98 on July 25, 2010, 10:23:05 pm
Wow, how did I never see that game before?
If you can do that game in basic with a decent speed, whether it uses ans or not, I would request it to be featured.  :)
Title: Re: Answer Programs
Post by: _player1537 on July 25, 2010, 10:24:34 pm
I had a much lower res version on my calculator... well maybe not low res, but lower detail.  It stayed on my calc forever, but I couldn't find the exact one on ticalc.org :/  Anyways, I can't promise I will work on it tonight (band camp in the morning) but I'll find time ^^
Title: Re: Answer Programs
Post by: Builderboy on July 26, 2010, 01:34:04 am
I was never good at making games using answer only x.x i never got the hang of it.  Good job on all of these!
Title: Re: Answer Programs
Post by: DJ Omnimaga on July 29, 2010, 02:31:11 am
Wow interesting way of coding. Nice to see we can make basic games with minimal var usage :)

I never managed to figure out myself. Anything I tried to do always seemed to overwrite Ans at one point
Title: Re: Answer Programs
Post by: calcdude84se on July 29, 2010, 11:33:30 am
The main problem is with modifying a single value in a list. Using augment( and seq(, despite being the only way to do it, is slow for a large number of values.
I might try my hand at making an interesting game with this method at some point. :)
Title: Re: Answer Programs
Post by: yunhua98 on July 29, 2010, 11:34:37 am
Well, you can't display scores with it anyway, since pause modifies Ans.
Title: Re: Answer Programs
Post by: calcdude84se on July 29, 2010, 12:02:12 pm
You can use Disp, followed by a no-argument Pause ;D
Title: Re: Answer Programs
Post by: yunhua98 on July 29, 2010, 12:03:20 pm
wait, doesn't that reset it as well?
Title: Re: Answer Programs
Post by: calcdude84se on July 29, 2010, 12:06:00 pm
I don't think so... What would it set it to? :P
Title: Re: Answer Programs
Post by: ztrumpet on August 02, 2010, 11:36:25 am
Nice job tanner!  As for movement in Elmgon, I was inspired by Harrier Falcon's Metroid Pi. ;D
Title: Re: Answer Programs
Post by: _player1537 on August 29, 2010, 02:15:03 am
sorry for the necropost :P

Quote from: calcdude84se
The main problem is with modifying a single value in a list. Using augment( and seq(, despite being the only way to do it, is slow for a large number of values.

On mine, I always just updated the entire list at once:
{ans(1),ans(2),ans(3)+(ans(1)=26)-(ans(1)=24)
{ans(1),ans(2)+1,ans(3)
<etc>

Oh, and for displaying scores, I typically use (assuming ans(1) is my getkey position:
Disp <score>
repeat ans(1
{getKey,<rest of the ans(x) statements>
End

Oh, and to set a variable without disrupting answer:
for(B,-500,<value to set (>-500)>:End

And sometimes, for subroutines, or when I don't want to hard code the positions in (might make sense in the example, or for example when using disp or output() statements), I use:
augment(ans,{value(s)
Output(ans(dim(ans)),1,"The Game
Output(ans(dim(ans)-1),3,"You lost!

I can't really think of any other Answer routines, if I do I'll post/edit them in.  If you have any, post them :)


(Oh, and for the asteroids game, it was coming along quite nicely :D  I think I have it saved in one of my backups somewhere.  It ran really quickly (or looked like it ;)) As did my galaxian clone answer program :D)
Title: Re: Answer Programs
Post by: Builderboy on August 29, 2010, 02:17:28 am
Oh, and to set a variable without disrupting answer:
for(B,-500,<value to set (>-500)>:End

Doesnt For(B,#,#):End Also work to set B to #+1?
Title: Re: Answer Programs
Post by: _player1537 on August 29, 2010, 02:20:13 am
Yep :)