Author Topic: Improvements  (Read 6848 times)

0 Members and 1 Guest are viewing this topic.

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Improvements
« on: March 21, 2011, 11:10:45 am »
I'm trying to come up with improvements to my latest version of my longish running 84+ SE game series, Zer0es, Zer0es IV (aka Zer0GS). Problem is, I don't know what needs improvement. This topic here is for code improvements. There is now a separate thread in the Projects section for new features and gameplay improvements.

The controls are as follows:
Left to move the falling number one column to the left, right for right.
Up to send the number all the way to the bottom (hard drop). There is no soft drop; it caused too many bugs.
Enter to pause, clear to quit.

The object of the game is to get all the numbers at the bottom of the screen to equal 0. This is done by maneuvering the falling number so that it lands in a column with a number so that the sum mod 10 of the two numbers is 0. I know it sounds confusing, but you'll get the hang of it. The game and all the needed programs are attached in the form of a group. Oh, and the minimum score is -999. Any lower than that and you automatically fail.
And please, read the ReadMe.

Screen shot!:
« Last Edit: March 23, 2011, 04:57:59 pm by Freyaday »
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Improvements
« Reply #1 on: March 21, 2011, 04:55:51 pm »
Are you asking for help with TI-BASIC for optimizations, how to do something, etc. or are you more asking improvements for the game like functionality wise and such? If it's the second I think this should probably be moved into the projects sections.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: Improvements
« Reply #2 on: March 21, 2011, 04:57:02 pm »
Both.
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Improvements
« Reply #3 on: March 22, 2011, 12:00:15 am »
Okay, well I haven't done a whole lot of looking over your code yet. So these are just basic things so far.

First I might suggest to put it all into one program. It's easier to deal with when giving it to other people and groups can get wonky sometimes. Just a suggestion.

prgmNAME could be changed too

Code: [Select]
a+bi
Full
ClrHome
Disp "MY","NAME","IS","FRIDAY
rand(15
ClrHome
Disp "THE","SERIAL","TIME","KILLER.
rand(15
ClrHome

I don't know if the Disp changes affect the size any but ya. But I'm not sure why you had the If dim(rand(15)) lines. If it was just a pause effect then all you need is the rand(15). The If statement is unnecessary because the dimension of the list created will always not zero since your declaring the size to be fifteen elements.

As for prgmDELVAR I would suggest only make it the variables you use or just get rid of it all together. I just mean to run it at the beginning seems kind of redundant if you're going to be replacing all those values with the starting values and all. As it is nice to clean the program up with that type of thing it isn't necessary so it will be your call. I'll look over the rest of the code of the main program when I get a chance.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: Improvements
« Reply #4 on: March 22, 2011, 12:23:27 am »
Those two programs are ones I use in almost every one of my other programs, so the space savings really make themselves known when you've got a bunch of my programs on the calc. I'm not dismissing anything you've said, these are valid concerns (aieee! I sound like a suit!) I'm just explaining them. Also, the If dim( was so that rand(15 wouldn't change Ans. Also, have you found any bugs?
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: Improvements
« Reply #5 on: March 22, 2011, 11:50:41 pm »
Bump.
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Improvements
« Reply #6 on: March 23, 2011, 01:04:09 am »
Is there anything your particularly looking for? A certain part that you want to see if can be made faster, parts to be made smaller, improvements that you've thought of but not sure about?
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: Improvements
« Reply #7 on: March 23, 2011, 11:12:51 am »
Anything at all. I really don't know what needs improvement.
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Improvements
« Reply #8 on: March 23, 2011, 11:28:22 am »
First, ( I dont know if you have already done this ) delete ALL closing brackets and quotes from the end of each line.
« Last Edit: March 23, 2011, 11:30:35 am by aeTIos »
I'm not a nerd but I pretend:

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: Improvements
« Reply #9 on: March 23, 2011, 11:35:31 am »
I automatically do so when I write my programs, and I order my expressions to put as many )s at the end as possible so as to elimnate as many of them as possible.
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Improvements
« Reply #10 on: March 23, 2011, 12:01:24 pm »
First, ( I dont know if you have already done this ) delete ALL closing brackets and quotes from the end of each line.

He's actually quite good at that as far as I can tell.

prgmDELVAR:

  • DelVar L1DelVar L2DelVar L3DelVar L4DelVar L5DelVar L6 can be changed to ClrAllLists (in 2nd+[MEM]). Put that at the end of the chain of Delvar 's, of course.

prgmNAME:

  • As meishe91 suggested, chain all those Disp 's together.

prgmZER0ES:

  • Any reason you need the line SetUpEditor∟Z? 5→dim(∟Z creates LZ for you.
  • seq(randInt(1,9),Q,1,2→L3 is simply randInt(1,9,2→L3
  • DelVar ∟Z:Disp "CHEAT!can be optimized to DelVar LZDisp "CHEAT!
  • seq(randInt(1,9),Q,1,8→L1 is simply randInt(1,9,8→L1
  • 12randInt(1,8→C:C-6→C is smaller as 12randInt(1,8)-6→C
  • For(Q,6,90,12:Text(‾1,56,Q,sub("123456789",L1(.5+Q/12),1:End is smaller and faster as For(Q,1,8:Text(‾1,56,12Q-6,sub("123456789",L1(Q),1:End
  • If D and not(N can become If Dnot(N.
  • Repeat K=105 can become While K-105
  • The second line in (K=34)-(K=25)+∟Z(Z→∟Z(Z:∟Z(Z)-27(∟Z(Z)>28)+27(2>∟Z(Z→∟Z(Z can use Ans instead of LZ(Z).
« Last Edit: March 23, 2011, 12:18:16 pm by Deep Thought »




Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: Improvements
« Reply #11 on: March 23, 2011, 12:11:53 pm »
Oh, okay. See, that's the kind of stuff I'm talking about. Also, the reason I'm using SetUpEditor is that it UnArchives LZ if it it exists in Archive, does nothing if it exists in Archive, and creates it with zero elements if it doesn't exist, which is why the following line is 5->dim(LZ
Also, I worked it out, and chaining the Disps is the exact same size as creating separate lines for them, because when chaining, the 2 bytes saved by not putting :Disp is offset by having to add ", instead. Unless it's faster one way or another, I don't see a reason to change it. Also, the problem with While loops is that they test at the beginning instead of the end, so the savings are counteracted by having to put 0->K before everyone of them.
PS: Yay, a compliment!
« Last Edit: March 23, 2011, 12:18:49 pm by Freyaday »
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Improvements
« Reply #12 on: March 23, 2011, 12:15:29 pm »
Oh, okay. See, that's the kind of stuff I'm talking about. Also, the reason I'm using SetUpEditor is that it UnArchives LZ if it it exists in Archive, does nothing if it exists in Archive, and creates it with zero elements if it doesn't exist, which is why the following line is 5->dim(LZ

Ah, I see.

Also, I worked it out, and chaining the Disps is the exact same size as creating separate lines for them, because when chaining, the 2 bytes saved by not putting :Disp is offset by having to add ", instead. Unless it's faster one way or another, I don't see a reason to change it.

I think it is faster.

Also, the problem with While loops is that they test at the beginning instead of the end, so the savings are counteracted by having to put 0->K before everyone of them.

In that particular case you're fine because (I think) K cannot be 105 at that point.

Also, see my post above for more optimizations (particularly with seq( and For( loops).




Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: Improvements
« Reply #13 on: March 23, 2011, 12:21:19 pm »
Problem is, with the While loops, I can't take a chance like that. Also, they take up more bytes when executing and are actually slightly slower.
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Improvements
« Reply #14 on: March 23, 2011, 12:24:49 pm »
Oh, here's a big one: Instead of putting prgmDELVAR in a separate program, put it at the very end of prgmZER0ES, with a label. Each time you call it, just Goto the label. Once it hits the end of the program, control returns to wherever the label was called.