First off, I cant tell you all how gratefull i am for your help. I know its been a while, but i have made 10+ fairly simple games in the past few months, but games nontheless. I do have some issues that i would like to address though...

a) Highscores: i had the idea of storing high scores as lists, but when I program the calculator to compare a variable, say S, to a highscore list, like LHIGH, SURPRISE error... Hiw can i compare apples (variables) to oranges (lists)?

b) timer: health class is a drag, so i made a program to calculate heart rates so i didnt have to do it manually. My timer idea would say something like this:

:gettime --> L1
:L1 --> L2
:While 1
:If gettime>L2 :gettime --> L2
:If L1+{10}=L2: goto A
:End
:Lbl A
(rest of program...)

So yeah not sure whats up there... Any help would be appreciated


c) I am trying to experiment with an IM program, and instead of GetCalc(Str1 or other strings, is there any way to get the home screen of a connected calculator? This would shorten my program by 50%

d) why cant one program unarchive and run onther program? Also i have made a 'DIYPRGM', where the user inputs math formulas and the program stores the formula and codes in Str1 to be recalled in a new program, and wala! A new program with all the nesecary code! But is ther a way of simply creating a new program while running 'DIYPRGM', placing this formula and the associated code in the said new program, and poof-having a new program?

Thanks for the help Cemetech is an awesome resource for free time programmers like me you guys are great Smile
a) LHIGH(1) will get the first element of LHIGH for you so you can compare it to other real variables.

b) Timers aren't really very accurate in BASIC due to BASIC's slowness. I would use someting else instead of a true timer in your game, such as a For() loop.

c) Nope, not without ASM.

d) You would use the Celtic 3 libraries for this.
a) And you can store A->LHIGH(1) and LHIGH(1)->A, if you need.
b) Timers are accurate enough, imho, other than a sub-second inaccuracy, which would indeed break an application like this, regardless.
c) ^What souvik said
d) Use the Celtic III libraries that Doors CS provides
Ok so after list LHIGH put parenthesis 1? Like LHIGH(1) and that makes it comparable to a variable?
Essentially.

A list has elements, where the values are stored. You cannot exceed the length of the list (found by simply doing a dim(LHIGH))

Also, using lists are slower than just using variables, so don't use lists in speed intensive bits of code.
tifreak8x wrote:
Essentially.

A list has elements, where the values are stored. You cannot exceed the length of the list (found by simply doing a dim(LHIGH))

Also, using lists are slower than just using variables, so don't use lists in speed intensive bits of code.


Yeah i know lists are slow but you can have lists that are arc and un-arc at the start and end of each program that are saved and not used in any other program, like i dont want to save a high score as variable Z, because chances are ill use it in another program and its value will change. Well thanks for the help ill try it out tomorrow.
rcplanegy wrote:
tifreak8x wrote:
Essentially.

A list has elements, where the values are stored. You cannot exceed the length of the list (found by simply doing a dim(LHIGH))

Also, using lists are slower than just using variables, so don't use lists in speed intensive bits of code.


Yeah i know lists are slow but you can have lists that are arc and un-arc at the start and end of each program that are saved and not used in any other program, like i dont want to save a high score as variable Z, because chances are ill use it in another program and its value will change. Well thanks for the help ill try it out tomorrow.


Yes, you can. The problem here is that any program can access any list, so you have to give you list a unique name. To do that, the first time your program is run, do something like this:


Code:

{0}->LFOO


There is a great tutorial on highscores. I recommend browsing through the entire sire, as it is a great resource. BTW, what is your game about?
RCPlanegy, think of it like this. A real variable (that is, A-Z and theta) holds one number. You could conceptually string a few of these Reals together in a row, like {A, B, C, D, E}. A list lets you do exactly that. If you have a five-element list, then LMINE(1) is the first element, LMINE(2) is the second element, etc. You can use each of those just like Reals. The difference is that LMINE is a single entity, not five individual variables stored, and you can do things with LMINE on its own. For example, 6->dim(LMINE to make LMINE 6 elements, or dim(LMINE)->X to find out how long LMINE is.
As another point, there is a function (on TI-84+/SEs) that takes the current time, in seconds since <insert time here>. It is called `StartTimer' and you can use it (and should) with `CheckTimer(' to check the seconds since when you used `StartTimer'. For instance, here is a program that will count the number of seconds until you press [2nd] and will display the time as it goes.
Code:
StartTimer->T
0->K
While K != 21
::Disp CheckTimer(T
::GetKey->K
End
Disp CheckTimer(T
Also, TIFreak's website, tifreakware.net is an excellent resource for TI-Basic game-coding.
Definitely a good site for it. What about the code that you could use to make sure you're at least sort of starting at the beginning of a second?


Code:
:StartTimer->T
:While not(CheckTimer(T
:End:StartTimer->T


I _think_ that would do it
  
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