Jump to content



Photo
- - - - -

Programming Tips


  • Please log in to reply
10 replies to this topic

#1 genesis

genesis

    UCF BASIC Programming Runner Up

  • Super Member
  • PipPipPipPip
  • 281 posts
  • Location:Perth, Australia
  • Interests:Speaking German, computers, defending CFX calculators...

  • Calculators:
    CFX 9850 GB+

Posted 28 April 2003 - 03:35 AM

1. Put the main loop of your program at the beginning (e.g. gameplay for games, calculation for programs) because most commands start searching at the front of your program. An example if you don't belive me is in programming. Press Top and Bottom and you'll find Bottom takes longer. To do this, place Goto * at the beginning of your program and Lbl * with all your title screens and options at the end. I did this in Secret of Aan and the character moves twice as fast!

2. Use Locate mode where possible if using CFX (ignore those AFX users!!!). It is much faster (and someone see if Graph mode is faster on 9850 G cause I had one for one day and it was so fast!!! Locate mode has the scroll option and the only con is bad graphics but good text.

3. Look out for alternatives for saving memory. A certain part of your code can be shortened. For example, all commands like Mat#[*,*] don't need closing brackets. Find out where *+1->* can be replaced by Dsz. Although cheap, see if the text your displaying is a programming code (e.g. Locate). When modifying a matrix or list file a lot, convert it to a variable first and then covert it back later. Try not to use colour unless it is easier to understand as it is decoration for memory.

4. Don't list instructions and storylines in your program, no-one reads them and they are a waste of memory. Be like Street Fighter and list it in a HTML document for all to read (Mac and <{GNULINUX}>).

5. Try not to draw too much in your program and draw using the least commands possible. The appreciation of them is overshadowed by the memory taken up and the speed. You can use many commands to replace what you have drawn. You can use F-Line's and Text (like Joker's Wild) to replace pictures.

#2 Pixter

Pixter

    Casio Fan

  • Members
  • PipPip
  • 43 posts
  • Location:The Netherlands
  • Interests:casio, visual basic, lego mindstorms and formula 1.

  • Calculators:
    cfx9850gb plus

Posted 28 April 2003 - 06:59 AM

Maybe Crimsoncasio can make a tips and tricks section in his tutorial and add your tricks :)

#3 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 28 April 2003 - 09:34 AM

1) this is true, but if you do as I have said in another post (and will be in my tutorial) if you split everything up into diffrent programs then all parts of your code move at fast speeds, increasing the total game play speed considerably. plus, its not just that searching starts at the top, its also that with every byte in the program it gets slower, try typing at the bottom of a 10000b prog, its not fun... worse yet, try scrolling up.

2) use both in tandem (see lesson 8 of my tutorial) both have their uses.

3) I agree with everything you said here, except not to use color, on the graph mod color is very useful, since it is layered orange pixles are at the top, then green, then black/blue, this means that black pixels overwrite nothing but other black pixels so you can make a background in orange and green and your character (in black) can move about freely.

4) in RPG's storylines can be nessicary, put them in a seperate text file to prevent clogging up your programs.

5) on drawing, the only command you must not use is circle, it is increadably slow. if you must draw a circle create your own code to do so:
for 0->D to 360 step 15 // ~30
plot sin D, cos D
Line
Next


#4 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 28 April 2003 - 09:53 AM

1) This is true only for labels and gotos. For, While, and Do loops push their offset onto the stack so no searching is required

5) To plot a circle (or a box, or a triangle, or some other shapes as well) you can use Paramtric graphs.. that is usually faster :)

#5 genesis

genesis

    UCF BASIC Programming Runner Up

  • Super Member
  • PipPipPipPip
  • 281 posts
  • Location:Perth, Australia
  • Interests:Speaking German, computers, defending CFX calculators...

  • Calculators:
    CFX 9850 GB+

Posted 28 April 2003 - 11:17 AM

Wow, you guys are experts... I may have added some of that stuff but I those are my main techniques. Plus, I got disconnected. :rolleyes: And with the programming thing, THAT'S EXCACTLY WHAT I WAS GOING TO POST.

I'm sick of all those reviewers on the Internet complaining about too many programs in for one game. Someone creates a whole program for you and you don't even have the decency to scroll a bit without complaining!!! :profanity:

#6 Casto Productions

Casto Productions

    Casio Freak

  • Members
  • PipPipPipPip
  • 152 posts
  • Location:IL, USA

  • Calculators:
    TI-83, TI-86, CFX-9850, AFX2.0

Posted 28 April 2003 - 12:50 PM

Multiple files are ok, but I don't like to get carried away with it. I use a lot of Do LpWhile loops and things like that because Goto Lbl loops are impossibly long with the way the calculator searches. To me, it seems as though the calc searches downward in the code from the Goto command, and if it doesn't find it down, then jumps to the top of the program and searches from the front down. SLOWWWW... Multiple programs help quite a bit, but just be sure to name the extra programs properly, like starting them with a "~" or something because I know I always have programs on my calc that I don't feel like searching for just to use. :D

#7 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 28 April 2003 - 05:24 PM

in my tutorial there is a section called good programming techniques which covers this kind of stuff.

by the way all contributions are welcome...

#8 rjstephens

rjstephens

    Casio Freak

  • Members
  • PipPipPipPip
  • 239 posts
  • Location:Brisbane, Queensland, Australia

  • Calculators:
    CFX9850GB+

Posted 05 May 2003 - 11:58 AM

3) Shouldn't that read +1-> can be replaced by Isz? And also, Be REALLY CAREFUL!!! Isz usually isn't a problem but i have had countless errors with Dsz because it was 0.

For the hollow-heads here (you know who you are) If a variable calculated with Isz or Dsz =0, then it will skip the next comand. This can create problems.

#9 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 05 May 2003 - 01:00 PM

think everyone understood what he ment. and he also said "Find out where *+1->* can be replaced", implying it can't be replaced everywhere (as you said, if the statement results in 0, the next command is skipped, which can useful)

and, please don't call ppl names, like hollow-heads.. :angry:

#10 huhn_m

huhn_m

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1957 posts
  • Gender:Male
  • Location:Germany / Dresden
  • Interests:Assembler(!!!)
    Computers and Programming
    Operating Systems
    Programmable Calculators
    Maths and everything arround it

  • Calculators:
    FX-82SX / AFX 2.0+ (ROM 1.03) / FX 1.0+ (ROM 1.03)

Posted 05 May 2003 - 01:41 PM

@rj:

I don't know ahy you are so mad the last days but i don't like it if one calls me
tempered of who I think isn't better then me. I didn't know the fact that
ISZ/DSZ skipps the next command if result is 0 but you also don't know
things I know (for sure!) but you don't have to scream your anger for
anything out by insulting other ppl.

#11 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 05 May 2003 - 03:25 PM

yeah rj, there are lots of people here who could justly call you the same thing ( :rolleyes: ) but dont. you seem to be acting strangely latley, just cool it otherwise action might have to be taken. also if your speaking sarcastically clarify your meaning with a :D or :lol: or the like.

:D




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users