I keep on coming back with more problems, so I'll just post this and other problems here:
this conglomeration of code won't work due to a small piece in it, the 3:=dim(lslist) part.

apparently it's supposed to work?

you can't set 3 to anything but my buddy working on it says it's a general ti basic command.


Code:
Define test2()=
Prgm
:If prgmunlock=1 Then
:Local die
:Local total
:die:=randInt(1,6)
:For x,1,4
:die:=randInt(1,6)
:die:=lslist(x)
:EndFor
:SortD lslist
:"3:=dim(lslist)"
:For y,1,3
:total:=total+lslist(y)
:EndFor
:EndIf
:EndPrgm
I know that CLEARAZ clears variables a through z, is there a function that purges every variable?
We ask that you please edit your post instead of double-posting if it's within 24 hours of your first post. With regards to your question in the first post, although I am not an Nspire BASIC coder, from my TI-BASIC training I believe the correct ordering would be:
Code:
dim(lslist):=3
This would set the dimension (length) of lslist to 3.
Alright, if lslist is a list as I think it is, you cant set its dim, and to get a number back from the list, you use brackets, not parenthesis. If you use parenthesis then the Nspire thinks you are calling a function.
  
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