The program itself usually isn't the issue. Stuff like graphics is what makes things take a long time to download. Besides, I wouldn't worry about the download time. Even with games containing fully custom graphics, it doesn't take THAT long to download.
Worry more about making something that works and that you enjoy rather than shrinking your code.
How do I keep my code tiny?
Root / Programming Questions / [.]
GuzzlerCreated:
There are probably tricks to keeping a program small such as keeping variable names short, but I have found that keeping the code simpler and more readable is far more valuable in the long run. I makes it much easier to debug and upgrade later. And randomouscrap is right, programs take up a small amount of the total data and thus download time.
The replies are 100% correct. Storage is cheap and plentiful, whereas processing power is limited.
There are no real benefits to be gained from doing this.
But it's an interesting question! :-)
I can think of two ways:
Firstly, generate your graphics and other large data with code when your program is first run. Save the generated graphics to files, and then use those files on subsequent program executions.
(I'm in the middle of typing up a tutorial on using Simplex noise to create graphics with SB - thoroughly impractical, but fun)
Secondly, write a compression/decompression program which uses the PRGGET and PRGSET functions to read in your game's code and write out a shortened version of it.
In its simplest form, it could map all of the SB function names to shorter versions.
If all of the functions were translated to integers in the 0-255 range, then you could use the RGB() function to quickly pack three or four of them into an 8-bit hex number...
...and...if you could convert a whole program into a stream of RGB()-encoded information, then you could conceivably make a way for programs to be shared via PNG image, bypassing SB's official method of distribution...