Don't have an account? Register now to chat, post, use our tools, and much more.
Latest Headlines
Online Users
There are 88 users online: 2 members, 56 guests and 30 bots. Members: None. Bots: VoilaBot (3), Spinn3r (1), Magpie Crawler (6), VoilaBot (1), Googlebot (18), MSN/Bing (1).
RSS & Social Media
SAX
You must log in to view the SAX chat widget
|
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.
 TI-Basic Brain Teasers => TI-BASIC
| Author |
Message |
|
Baruch
Newbie

Joined: 24 Dec 2008 Posts: 5
|
Posted: 26 Dec 2008 06:21:51 am Post subject: |
|
|
Thank you ! The prog has 52 bytes on my TI, with one letter for the name, how can it comes in at 55 bytes ? If I use an user-defined list, how can I have the N-th number of the list ?
By the way, whay can't I see the codes in quotes ?
Sorry for my english, I'm french. |
|
| Back to top |
|
|
thornahawk μολών λαβέ
Active Member

Joined: 27 Mar 2005 Posts: 569
|
Posted: 26 Dec 2008 11:10:22 am Post subject: |
|
|
| Baruch wrote: | If I use an user-defined list, how can I have the N-th number of the list ?
[post="130682"]<{POST_SNAPBACK}>[/post] |
If your user-defined list is named, say, ∟A, the N-th element of that list is ∟A(N).
| Baruch wrote: | By the way, whay can't I see the codes in quotes ?
[post="130682"]<{POST_SNAPBACK}>[/post] |
To see them, just press the keys 'Ctrl' and 'A' simultaneously. Alternatively, right click inside the quote box and click "Select All". :D
thornahawk |
|
| Back to top |
|
|
Baruch
Newbie

Joined: 24 Dec 2008 Posts: 5
|
Posted: 26 Dec 2008 11:30:22 am Post subject: |
|
|
| Thank you, I see that someone did the same code (well, better than me ^^). |
|
| Back to top |
|
|
simplethinker snjwffl
Active Member

Joined: 25 Jul 2006 Posts: 700
|
Posted: 26 Dec 2008 01:21:32 pm Post subject: |
|
|
| Baruch wrote: | By the way, whay can't I see the codes in quotes ?
[post="130682"]<{POST_SNAPBACK}>[/post] |
As Thornahawk said, use ctrl-A (or just highlight it). The reason we use quotes is to hide the answer so you don't have to see the answer unless you want to.
Welcome to UTI Baruch! |
|
| Back to top |
|
|
Weregoose Authentic INTJ
Super Elite (Last Title)

Joined: 25 Nov 2004 Posts: 3976
|
Posted: 26 Dec 2008 09:35:33 pm Post subject: |
|
|
| Baruch wrote: | | Thank you ! The prog has 52 bytes on my TI, with one letter for the name, how can it comes in at 55 bytes ? | Oh... I was looking at the wrong program name in my list! You're right, it's 51 bytes. |
|
| Back to top |
|
|
bfr
Member

Joined: 13 Feb 2006 Posts: 108
|
Posted: 27 Dec 2008 11:36:23 am Post subject: |
|
|
Welcome, Baruch :biggrin:
Here's another solution that's 42 bytes but only works with positive real numbers (so 0 doesn't work either):
| Quote: |
Ans->A
{max(Ans
While min(Ans-min(LA
augment(Ans,{max((LA<min(Ans))LA
End
|
And here's an interesting method that I think might be the smallest if the list is inputted and outputted in LA (works only with positive real numbers again, and takes up 41 bytes):
| Quote: |
SortD(LA
LAaugment({1},not(not(ΔList(LA->A
SortD(LA
sum(Ans≠0->dim(LA
|
EDIT: and thanks to Weregoose for the tip that using custom lists like LA is often better than using built-in lists likeL1 because the L doesn't need to be included when storing to custom lists, which helped to make both of these routines a bit smaller
Last edited by Guest on 27 Dec 2008 11:53:06 am; edited 1 time in total |
|
| Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)

Joined: 04 Nov 2003 Posts: 8328
|
Posted: 27 Dec 2008 05:12:14 pm Post subject: |
|
|
Your second method can be modified to work with all real lists:
| Quote: | SortA(LA
augment({0},not(ΔList(LA→B
SortA(LB,LA
sum(not(LB→dim(LA
| It is, I think, larger than previously posted methods when you add in the code that puts input and output in Ans instead of LA.
Last edited by Guest on 27 Dec 2008 05:13:41 pm; edited 1 time in total |
|
| Back to top |
|
|
|
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
© Copyright 2000-2013 Cemetech & Kerm Martian :: Page Execution Time: 0.023833 seconds.
|