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 DSmile. 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.


Get the programs here
Very impressive! How ever did you manage to juggle something as complex as a map without ever touching Ans?
Oh yeah... forgot about that part...

The map is stored in Str1 at the very beggining, so technically it does touch ans... The boulder dodge program works completly from ans. Oh, and I could put the map inline with the code, thus not using str1, but it makes the code very hard to manage if I have to scroll through a 128+ character string to get to the code at the bottom

Edit: I just remembered I made a mouse routine that only touched answer too, I'll upload in a second
_player1537 wrote:
Oh yeah... forgot about that part...

The map is stored in Str1 at the very beggining, so technically it does touch ans... The boulder dodge program works completly from ans. Oh, and I could put the map inline with the code, thus not using str1, but it makes the code very hard to manage if I have to scroll through a 128+ character string to get to the code at the bottom
Ah, that explains my confusion, because on #cemetech on Efnet earlier I thought you said your programs only use Ans to work, and now I was reading that they can use anything except overwrite Ans. Smile
Figured out what my contest entry will be ^^ A Space Invaders program that uses only answer. It will be using Xlib, scan for pixel, and most likely Push/Pop/Swap answer Smile I might make a topic for it later when I get it to look better than it does atm.
_player1537 wrote:
Figured out what my contest entry will be ^^ A Space Invaders program that uses only answer. It will be using Xlib, scan for pixel, and most likely Push/Pop/Swap answer Smile I might make a topic for it later when I get it to look better than it does atm.
Awesome, I hope it works out very nicely! I guess that means I actually do have to implement this SwapAnsStack routine though. Sad
Idk, I just realized if I did end up using L1, I could just push the Answer with your ship's data, and start using L1 instead, then pop, and L1 will stay the same.
_player1537 wrote:
Idk, I just realized if I did end up using L1, I could just push the Answer with your ship's data, and start using L1 instead, then pop, and L1 will stay the same.
Would you care to test out the latest beta, which has multiple stacks? I have details here:

http://dcs.cemetech.net/index.php?title=BasicLibs:PushAnsStack
http://dcs.cemetech.net/index.php?title=BasicLibs:PopAnsStack
http://dcs.cemetech.net/index.php?title=BasicLibs:ClearAnsStack
This is my BOUNCING program, that is a line that will bounce around your screen. It accelerates toward the ground, and loses acceleration when it hits the ground, so isn't like pong with the pxl-change command. It only changes the window, and uses Ans. I also made one that you could control which direction it would accelerate towards (left, right, up, down, and intermediary directions), but I have long since lost it. If you guys want me to though I should be able to recreate it.

Anywho, this was my second version of this program. The original used several lines of code for the engine, but I got bored with that, and eventually modified the engine so it now manages all values with one line of code, without using any colons. Sure it isn't very practical, and is significantly larger that both the programs it was based off of, but it was interesting to make, and still interesting to watch. Btw, the code was rendered with Merth's Token IDE, so you know who to blame for anything that looks a bit odd.

Code:
:ClrDraw
:0->Xmin
:1->DeltaX
:~62->Ymin
:1->DeltaY
:Horizontal(0
:Horizontal(~62
:Vertical 0
:Vertical 94
:randInt(2,92
:{6,Ans,0,(2randInt(0,1)-1)randInt(1,randInt(1,5)),6,Ans,6,Ans,6,Ans,6,Ans,6,Ans
:While 1
:{Ans(1)+Ans(3)+1-(Ans(1)+Ans(3)+1 = 62),Ans(2)+Ans(4),Ans(3)+1-2(Ans(3)+1)(Ans(1)+2Ans(3)+2 >= 62)-10(Ans(1)+Ans(3)+1 = 62),Ans(4)-2Ans(4)(47 <= abs(Ans(2)-47+2Ans(4))),Ans(1),Ans(2),Ans(5),Ans(6),Ans(7),Ans(8),Ans(9),Ans(10),Ans(11),Ans(12),Ans(13),Ans(14
:Line(Ans(2),~Ans(1),Ans(6),~Ans(5
:Line(Ans(14),~Ans(13),Ans(16),~Ans(15),0
:End


The program is in the archives, just in case you don't want to type it up yourself.
Very very nice Mufin! Looks amazing Very Happy
_player1537 wrote:
Very very nice Mufin! Looks amazing Very Happy
Definitely seconded from what I have seen. Where did the screenshot go, though? It looked amazing.
MufinMcFlufin wrote:
This is my BOUNCING program,[...]


If you can tell me which part handles the direction, the acceleration, and the detection of the screen and I am sure it can't be that hard to make it move by getKey, then again I have been wrong before.
Sonlen wrote:
MufinMcFlufin wrote:
This is my BOUNCING program,[...]


If you can tell me which part handles the direction, the acceleration, and the detection of the screen and I am sure it can't be that hard to make it move by getKey, then again I have been wrong before.
Tell you what, how about you respond to this post with a guess about which variables and code handle what, and he/we can tell you if you're correct or wrong. You won't learn if everyone always gives you the answers. One learns by being challenged, being frustrated, and getting things wrong.
KermMartian wrote:
Sonlen wrote:
MufinMcFlufin wrote:
This is my BOUNCING program,[...]


If you can tell me which part handles the direction, the acceleration, and the detection of the screen and I am sure it can't be that hard to make it move by getKey, then again I have been wrong before.
Tell you what, how about you respond to this post with a guess about which variables and code handle what, and he/we can tell you if you're correct or wrong. You won't learn if everyone always gives you the answers. One learns by being challenged, being frustrated, and getting things wrong.

KermM's a better teacher than I...I was halfway through writing it all up before he almost ninja'd me with this.

Sonlen, there isn't much to the program itself. I agree with KermM, see if you can figure it out on your own.

P.S. KermM, the screenie was for a similar one. BOUNCE2 is the one with the screenie, and essentially does the same thing, with one difference in horizontal velocity, that I was too lazy to implement into this program.
Here goes nothing.


Code:
:ClrDraw
:0->Xmin
:1->DeltaX
:~62->Ymin
:1->DeltaY
:Horizontal(0
:Horizontal(~62
:Vertical 0
:Vertical 94
:randInt(2,92
:{6,Ans,0,(2randInt(0,1)-1)randInt(1,randInt(1,5)),6,Ans,6,Ans,6,Ans,6,Ans,6,Ans
:While 1
:{Ans(1)+Ans(3)+1-(Ans(1)+Ans(3)+1 = 62),Ans(2)+Ans(4),Ans(3)+1-2(Ans(3)+1)(Ans(1)+2Ans(3)+2 >= 62)-10(Ans(1)+Ans(3)+1 = 62),Ans(4)-2Ans(4)(47 <= abs(Ans(2)-47+2Ans(4))),Ans(1),Ans(2),Ans(5),Ans(6),Ans(7),Ans(8),Ans(9),Ans(10),Ans(11),Ans(12),Ans(13),Ans(14
:Line(Ans(2),~Ans(1),Ans(6),~Ans(5
:Line(Ans(14),~Ans(13),Ans(16),~Ans(15),0
:End



This handles the Initial coordinates I am almost 100% positive of it:

Code:
:randInt(2,92
:{6,Ans,0,(2randInt(0,1)-1)randInt(1,randInt(1,5)),6,Ans,6,Ans,6,Ans,6,Ans,6,Ans


This handles the Ans List from the previous snippet, and then it uses the equations in the List to change the coordinates that the Line( uses for display:

Code:
:{Ans(1)+Ans(3)+1-(Ans(1)+Ans(3)+1 = 62),Ans(2)+Ans(4),Ans(3)+1-2(Ans(3)+1)(Ans(1)+2Ans(3)+2 >= 62)-10(Ans(1)+Ans(3)+1 = 62),Ans(4)-2Ans(4)(47 <= abs(Ans(2)-47+2Ans(4))),Ans(1),Ans(2),Ans(5),Ans(6),Ans(7),Ans(8),Ans(9),Ans(10),Ans(11),Ans(12),Ans(13),Ans(14


I think that is really all that I needed to know for what I wanted to do with it.
Umm... Not to burst your bubble, but I think you need to know waaayyy more than that. For instance, what does element 5 of the list mean? Is it the X, Y, X velocity, Y velocity, or what? That's the kind of thing you need to be looking for in this.
_player1537 wrote:
Umm... Not to burst your bubble, but I think you need to know waaayyy more than that. For instance, what does element 5 of the list mean? Is it the X, Y, X velocity, Y velocity, or what? That's the kind of thing you need to be looking for in this.


I just meant the important parts of the code and how they work. >.>
Yes. This is very important imo. If you don't know where the X velocity is, how are you going to make it respond to keypresses?
_player1537 wrote:
Yes. This is very important imo. If you don't know where the X velocity is, how are you going to make it respond to keypresses?


I was told to say what I thought the parts of the code did, and that is what I did, I have no idea how the List is working, therefore I couldn't guess on that matter.
Sonlen wrote:
_player1537 wrote:
Yes. This is very important imo. If you don't know where the X velocity is, how are you going to make it respond to keypresses?


I was told to say what I thought the parts of the code did, and that is what I did, I have no idea how the List is working, therefore I couldn't guess on that matter.
No. You missed the whole point. If you know a language, you should be able to understand how it works by studying the code. If you can't, you don't know the language. There's nothing tricky or overly complex about how this simple segment of code works, and it should take you at most ten minutes of thinking and mental tracing to figure out what variables and list elements are for what.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement