Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
I've made the dimensions of the matrix [B] (1,2)
I want those 2 things to hold the score for my basketball game ((1,1) is player 1's score and (1,2) is player 2's score)

but this:
[B](1,1)+2->[B](1,2)
doesn't work.

I don't know how to use Matrices correctly or if this is even possible. Should I use a String instead? If you know how, please show me
Hi Ididagood, welcome to Cemetech. I am not sure what you are trying to do here. Since you only have 2 numbers, I would recommend using a list. Lists are a lot simpler and easier to use than a matrix. A list, like the name inplies is a list of numbers. To access a number in that list, us the name of the list, followed by a parenthesis and then the location of the number in the list. To access the first number, simply press 2nd+[L₁]+(+1+), which looks like L₁(1). To set both scores to zero, use {0,0}->L₁. To add 2 points to the first player's score, use L₁(1)+2->L₁(1). To add 2 to the second player's score, use L₁(2)+2->L₁(2), since you are accessing the second number in the list. Just remember that -> is the store character →, found on the [sto→] key. Hope this helps, and if you have any more questions, feel free to ask!
So the format is
[Listname] ( [position] ) + [#] → [Listname] ( [position] )
?
Oh no. I'm sorry to say, but my code wasn't working because I used a variable for the position of the value, and that variable was set to 0 instead of 1.
I just tested a simplified version of my matrix code again on a new program, and it works. I'm still going to use a list but I kind of feel bad that it wasn't working for the reason I thought of.
  
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 GMT - 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