Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's TI-BASIC subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. TI-Basic => TI-BASIC
Author Message
Spyderbyte


Advanced Member


Joined: 29 May 2003
Posts: 372

Posted: 21 Oct 2003 05:46:47 pm    Post subject:

Hey I think I already know the answer to this, but is there any optimixed way to create and access an inputed number of lists? Something to the effect of:

For(A,1,7
{1,2,3}->L(A)
End

Which would store {1 2 3} into L1- L7. I was hoping to avoid having to refer to each list in turn:

{1,2,3}->L1
{1,2,3}->L2....

I'm not too hopeful, but it was worth a shot!

Thanks!

Spyderbyte
Back to top
Toksyuryel
Crimson Dragon Software


Elite


Joined: 14 Jun 2003
Posts: 880

Posted: 21 Oct 2003 06:33:01 pm    Post subject:

Do the lists have identical dimentions?
Back to top
Spyderbyte


Advanced Member


Joined: 29 May 2003
Posts: 372

Posted: 21 Oct 2003 07:08:10 pm    Post subject:

Yeah, within one element, but that could easily be a zero if you want it to.

Thanks!

Spyderbyte


Last edited by Guest on 21 Oct 2003 07:09:21 pm; edited 1 time in total
Back to top
Darth Android
DragonOS Dev Team


Bandwidth Hog


Joined: 31 May 2003
Posts: 2104

Posted: 22 Oct 2003 08:21:39 am    Post subject:

um, without the use of asm prgms, you cant have a variable in the name of a list ( L(A) )
but...this is the best way (without asm):
{1,2,3->L1
L1->L2
L1->L3
L1->L4
L1->L5
L1->L6
etc.
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 22 Oct 2003 12:18:56 pm    Post subject:

Even better:

{1,2,3->L1
Ans->L2
Ans->L3
Ans->L4
Ans->L5
etc.
Back to top
Darth Android
DragonOS Dev Team


Bandwidth Hog


Joined: 31 May 2003
Posts: 2104

Posted: 22 Oct 2003 12:50:08 pm    Post subject:

Arcane Wizard wrote:
Even better:

{1,2,3->L1
Ans->L2
Ans->L3
Ans->L4
Ans->L5
etc.

um, no! they have the same size! L1 and Ans both take up one byte!
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 22 Oct 2003 02:42:23 pm    Post subject:

But Ans is faster.
Back to top
Spyderbyte


Advanced Member


Joined: 29 May 2003
Posts: 372

Posted: 22 Oct 2003 03:23:19 pm    Post subject:

Yeah I didn't think there was any faster way. Thanks for the suggestions, but I was a little too vauge in my original description. (I was in a hurry) In detail, what I was planning on doing was dealing out a deck of cards to however many people.

Thinking about it now I think I'll use code to the effect of:

Input "Players?",N
0->B
For(A,1,52,N
B+1->B
LDECK(A)->L1(B)
If N>1
LDECK(A+1)->L2(B)
If N>2
LDECK(A+2)->L3(B)
.....
End

If this works like it does in my head (there are probably errors, this is the first type I actually wrote it out, it should divide the shuffled LDECK into equal "hands".
For example, if there were four players, the loop should execute 13 times, and each list 1-4 would have 13 cards. I will of course have a minimum and maximum number of players, I just haven't decided on the numbers yet.

Thanks again though!

Spyderbyte


Last edited by Guest on 22 Oct 2003 03:24:16 pm; edited 1 time in total
Back to top
Toksyuryel
Crimson Dragon Software


Elite


Joined: 14 Jun 2003
Posts: 880

Posted: 22 Oct 2003 07:00:21 pm    Post subject:

Darth Android wrote:
Arcane Wizard wrote:
Even better:

{1,2,3->L1
Ans->L2
Ans->L3
Ans->L4
Ans->L5
etc.

um, no! they have the same size! L1 and Ans both take up one byte!

Spyder was actually using named lists in case you didn't notice. As far as I know, there is no "L7" Wink
Back to top
Display posts from previous:   
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
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are GMT - 5 Hours

 

Advertisement