### Author Topic: from the lower to the higher  (Read 2583 times)

0 Members and 1 Guest are viewing this topic.

#### joao9856

• LV3 Member (Next: 100)
• Posts: 73
• Rating: +3/-0
##### from the lower to the higher
« on: June 15, 2013, 04:48:39 pm »
is there any way to organize random numbers from the lowest to the biggest??

TI-Nspire CX calc

#### Hooloovoo

• Posts: 225
• Rating: +22/-0
##### Re: from the lower to the higher
« Reply #1 on: June 15, 2013, 05:02:22 pm »
Code: [Select]
rand(100)->tempSortA tempshould do what you want
"My world is Black & White. But if I blink fast enough, I see it in Grayscale." -tr1p1ea
Spoiler For some of the calcs I own:

(actually I have quite a few more than this, but I don't feel like making bars for them all.)

#### joao9856

• LV3 Member (Next: 100)
• Posts: 73
• Rating: +3/-0
##### Re: from the lower to the higher
« Reply #2 on: June 15, 2013, 05:16:33 pm »
can't seem to make it work could you explain it to me like i was a four year old??

#### Hooloovoo

• Posts: 225
• Rating: +22/-0
##### Re: from the lower to the higher
« Reply #3 on: June 15, 2013, 05:23:36 pm »
Code: [Select]
rand(100)gives a bunch of random numbers. It could be rand(42) or anything else

Code: [Select]
SortA tempsorts temp. Now, temp is something like
Code: [Select]
{0.011,0.0125,0.0151.....0.988}
"My world is Black & White. But if I blink fast enough, I see it in Grayscale." -tr1p1ea
Spoiler For some of the calcs I own:

(actually I have quite a few more than this, but I don't feel like making bars for them all.)

#### joao9856

• LV3 Member (Next: 100)
• Posts: 73
• Rating: +3/-0
##### Re: from the lower to the higher
« Reply #4 on: June 15, 2013, 06:01:57 pm »
i've searched and thats for lists, thinking is there any other way?

#### Xeda112358

• they/them
• Moderator
• LV12 Extreme Poster (Next: 5000)
• Posts: 4626
• Rating: +717/-6
• Calc-u-lator, do doo doo do do do.
##### Re: from the lower to the higher
« Reply #5 on: June 16, 2013, 09:22:18 am »
Well, is there any other way you had in mind? Using lists seems like the most straight-forward way. From this point, you can read list element 1, list element 2, list element 3, and so on.

#### TIfanx1999

• ಠ_ಠ ( ͡° ͜ʖ ͡°)
• CoT Emeritus
• LV13 Extreme Addict (Next: 9001)
• Posts: 6173
• Rating: +191/-9
##### Re: from the lower to the higher
« Reply #6 on: June 16, 2013, 05:46:00 pm »
^This. I'm not really sure what other way you would want to go about sorting numbers. From your post, I even assumed that you wanted a list.

#### joao9856

• LV3 Member (Next: 100)
• Posts: 73
• Rating: +3/-0
##### Re: from the lower to the higher
« Reply #7 on: June 17, 2013, 07:50:15 am »
the only problem is that i don't know how to place variables in a list.

I'm like this,

Code: [Select]
randint(1,50)->nrandint(1,50)->nnrandint(1,50)->nnnrandint(1,50)->nnnn
after this i'm as clueless as what to do as i can get

#### Matrefeytontias

• Axe roxxor (kinda)
• LV10 31337 u53r (Next: 2000)
• Posts: 1982
• Rating: +310/-12
• Axe roxxor
##### Re: from the lower to the higher
« Reply #8 on: June 17, 2013, 07:53:41 am »
If it's the same than with z80 basic (TI-Basic for TI-82 to 84+), then you can access each element of a list this way :
Code: [Select]
temp(1)temp(2)temp(3)...

#### Xeda112358

• they/them
• Moderator
• LV12 Extreme Poster (Next: 5000)
• Posts: 4626
• Rating: +717/-6
• Calc-u-lator, do doo doo do do do.
##### Re: from the lower to the higher
« Reply #9 on: June 17, 2013, 07:54:22 am »
I am not sure how it is done on the nSpire, but if it is similar enough to the 68K calcs, then you should be able to do something like this:
Code: [Select]
rand(50)→tempSortA tempAnd then to access a list element, you can do things like this:
Code: [Select]
temp[1]    ;retrieve list element 1n→temp[1] ; store n to list element 1
I hope this works and helps!

#### joao9856

• LV3 Member (Next: 100)
• Posts: 73
• Rating: +3/-0
##### Re: from the lower to the higher
« Reply #10 on: June 17, 2013, 08:00:53 am »
it say "error invalid data type"

#### Xeda112358

• they/them
• Moderator
• LV12 Extreme Poster (Next: 5000)
• Posts: 4626
• Rating: +717/-6
• Calc-u-lator, do doo doo do do do.
##### Re: from the lower to the higher
« Reply #11 on: June 17, 2013, 08:15:09 am »
At what line does it have an error?

#### joao9856

• LV3 Member (Next: 100)
• Posts: 73
• Rating: +3/-0
##### Re: from the lower to the higher
« Reply #12 on: June 17, 2013, 08:29:06 am »
at SortA temp line

#### Hooloovoo

• Posts: 225
• Rating: +22/-0
##### Re: from the lower to the higher
« Reply #13 on: June 17, 2013, 01:01:42 pm »
what does
Code: [Select]
disp tempdisplay?
"My world is Black & White. But if I blink fast enough, I see it in Grayscale." -tr1p1ea
Spoiler For some of the calcs I own:

(actually I have quite a few more than this, but I don't feel like making bars for them all.)

#### TheNlightenedOne

• LV6 Super Member (Next: 500)
• Posts: 427
• Rating: +16/-1
##### Re: from the lower to the higher
« Reply #14 on: June 17, 2013, 01:17:56 pm »
It displays whatever is stored in temp
"Eris" (Ndless 3.1)
"Keto" (Ndless 3.1)
"Luna" (AMS 3.10, HW4)
"Aurora" (2.55MP)