Hey Everyone,
I am making na game that 2 player game that they
play on the same calculator, but i need to figure out a way to record evch turn they take i am using it to determine the winner...

Any advice would be appreciated
thanks
Use a list. Such as 5->LTURN1(1 if player one score five points in the first turn. 7->LTURN2(1 if player two scores seven points in turn one.

This is a basic example. A simple algorithm can turn this into a small & powerful bit of code for your game Smile
I'd write your algorithim, but I'd need to know some structure of your game and I've been out of [BASIC] programming for years, I'd be a bit rusty and get a few things mixed up for sure Sad


Edit 2: Well, lets see.

-> is the assign value to variable character
T = Turn
P = Points for Player One
O = Points Player Two (Opponent)

Code:
:P->[sub]L[/sub]TURN1(T
:O->[sub]L[/sub]TURN2(T
I think that's all you'll need. Probably a label to jump to this algorithm.

Any one else have any thing to add in?
That sounds about right; you'll need to keep expanding each list as you go to make sure there's room to store each turn; comicIDIOT's code does that implicitly, but you could do it explicitly by length->dim(LNAME or the like.
So you probably want something like:


Code:
:0->P
:0->O
:0->T
:10->dim(LTURN1
:10->dim(LTURN2
:Lbl A
:T+1->T
: -----Play Code-----
:P->LTurn1(T
:O->LTurn2(T
:Goto A



Comic Idiot wrote:
"T" is Turn Number
"P" is Player 1 Score
"O" is Player 2 Score (Opponent)



What this will does is everytime the user enters play, it adds 1 to T each turn and will store the values of what the user gets as their score to turn "T", which increases each turn.

NOTE: This code has 10 turns, but this can be changed by changing

:10->dim(LTURN1
:10->dim(LTURN2

To

:X->dim(LTURN1
:X->dim(LTURN2
(X being how many turns you want)
OKay thanks both of you it will really help!
Cowman123 wrote:
OKay thanks both of you it will really help!
Let us know how the program goes, and of course stop by with any further questions. May I suggest you submit your program to the Archives when you finish 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