hey guys i just finished the first ever ti-basic include file like in C++

to include it you just type at the beginning of your program:


Code:

number of lines in your program -> b
program name -> Str0
prgm include


and it adds functions
You should post the source or put a link in your post so people can download it. What kinds of functions does it add?
it adds player functions. including:

:player - this draws a player to the screen

:plyrmove - this allows movement of the player

edit: found glitch player functions all the sudden not working
edit2: accidental ram clear deletes the include file
spud2451 wrote:
edit2: accidental ram clear deletes the include file
RAM Clears in general will delete it. You need a way for the program calling the include to unarchive it, then re-archive it when it returns control back.

I think I'm missing the concept but one way or anther to avoid deletion on RAM Clear, you need to find way to execute it while the include is archived.
here's the code


Code:

:For(N,5,B,1)
:det(5,Str0,N)→Str1
:If Str1="PLAYER"
:Then
:identity(5,"182424183C5A3C66",1,8,X,Y,3,0,1
:End
:If Str1="PLYRMOVE"
:Then
:0→A
:While A=0
:getKey→A
:End
:identity(5,"182424183C5A3C66",X,Y,1,8,3,0,1
:If A=24
:Then
:X-1→X
:End
:If A=25
:Then
:Y-1→Y
:End
:If A=26
:Then
:X+1→X
:End
:If A=34
:Then
:Y+1→Y
:End
:End
:If Str1≠"PLAYER" and Str1≠"PLYRMOVE"
:Then
:det(6,"XYZPRGM",Str1,1
:prgmINCLUDE
:End
:End
Interesting. I really doubt this is the "first" time something like this has been made (in fact, you could call any Hybrid BASIC utility an "include file") but good job nonetheless Smile
Comic, funnily enough, Doors CS via xLIB lets you execute archived BASIC programs from other BASIC programs. Spud, this seems fairly nifty; not something terribly new, per se, but a new way (and more categorical way) of looking at it. Well done. But please, make friends with your shift key. A topic title gets all non-articles capitalized.

Code:
:For(N,5,B,1)
:det(5,Str0,N)→Str1
:If Str1="PLAYER"
:identity(5,"182424183C5A3C66",1,8,X,Y,3,0,1
:If Str1="PLYRMOVE"
:Then
:Repeat A
:getKey→A
:End
:identity(5,"182424183C5A3C66",X,Y,1,8,3,0,1
:X-(A=24)+(A=26->X
:Y-(A=25)+(A=34->Y
:End
:If Str1≠"PLAYER" and Str1≠"PLYRMOVE"
:Then
:det(6,"XYZPRGM",Str1,1
:prgmINCLUDE
:End
:End


Optimized! On that note, I am very surprised that this actually works >.> Shouldn't you call prgmXYZPRGM since you just wrote a line of code to it? Calling prgmINCLUDE again should make an endless loop, no?
Mmm, I should definitely think so. Good catch on that last bit, Catherine.
  
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 1
» 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