War
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
War
Author Message
dxfan101010


Member


Joined: 31 Mar 2008
Posts: 194

Posted: 08 Jul 2009 12:17:20 am    Post subject:

I want to make a war game soo Can any one tell me how to take a number from the beggining of one list and add it to the end of another
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 08 Jul 2009 01:29:00 am    Post subject:

Extract a list element with listname(#. Store to a list element with listname(#. If the element number is one higher than the dimension of the list (and no more), then the list will automatically adjust its length to compensate. You may also augment( one list with an element from another list. If any of this gives you trouble, then start here.

Last edited by Guest on 05 Jul 2010 08:24:09 am; edited 1 time in total
Back to top
woodswolf


Advanced Newbie


Joined: 26 Feb 2009
Posts: 53

Posted: 08 Jul 2009 12:02:22 pm    Post subject:

L1(1->L2(1+dim(L2 ???
Back to top
maverik94


Advanced Newbie


Joined: 20 Oct 2008
Posts: 57

Posted: 10 Jul 2009 04:23:35 pm    Post subject:

war...as in the card game war?
Back to top
dxfan101010


Member


Joined: 31 Mar 2008
Posts: 194

Posted: 10 Jul 2009 11:34:19 pm    Post subject:

yessire the one were the high card wins
Back to top
Graphmastur


Advanced Member


Joined: 25 Mar 2009
Posts: 360

Posted: 11 Jul 2009 03:28:40 pm    Post subject:

Oh I get it. What I would do, is see who won, and store the cards in a backup list. Then, when one person just used his last card, store the temporary list as his cards, and augment the other temporary list onto the main one.
Back to top
IAmACalculator
In a state of quasi-hiatus


Know-It-All


Joined: 21 Oct 2005
Posts: 1571

Posted: 13 Jul 2009 07:55:59 am    Post subject:

The thing about war is that it doesn't even require a GUI. You could do something like this:
If rand(2)=1
Then
Disp "P1 Wins!
Else
Disp "P2 Wins!
End


...but that wouldn't be the point, would it.


Last edited by Guest on 05 Jul 2010 08:24:38 am; edited 1 time in total
Back to top
Builderboy2005


Advanced Newbie


Joined: 19 Apr 2009
Posts: 51

Posted: 13 Jul 2009 03:05:39 pm    Post subject:

IAmACalculator wrote:
If rand(2)=1
Then
Disp "P1 Wins!
Else
Disp "P2 Wins!
End


ERR:SYNTAX
1:Goto
2:Quit

Buuut, I think we all get what you're trying to say Smile


Last edited by Guest on 05 Jul 2010 08:24:56 am; edited 1 time in total
Back to top
ztrumpet


Active Member


Joined: 06 May 2009
Posts: 555

Posted: 13 Jul 2009 03:25:00 pm    Post subject:

Builderboy2005 wrote:
IAmACalculator wrote:
If rand(2)=1
Then
Disp "P1 Wins!
Else
Disp "P2 Wins!
End


ERR:SYNTAX
1:Goto
2:Quit

Buuut, I think we all get what you're trying to say Smile
lol Very Happy
I can't believe I (or anyone else) didn't notice that! Smile


Last edited by Guest on 05 Jul 2010 08:25:14 am; edited 1 time in total
Back to top
IAmACalculator
In a state of quasi-hiatus


Know-It-All


Joined: 21 Oct 2005
Posts: 1571

Posted: 13 Jul 2009 03:48:10 pm    Post subject:

Hey, cut me some slack! My brother's the one with the 83+, not me! I've got an 89Ti:

Define war()=when(rand(2)=1,"P1 Wins!","P2 Wins!")


Last edited by Guest on 05 Jul 2010 08:23:51 am; edited 1 time in total
Back to top
dxfan101010


Member


Joined: 31 Mar 2008
Posts: 194

Posted: 14 Jul 2009 05:11:37 pm    Post subject:

lolz
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
War
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement