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 Brain Teasers => TI-BASIC
Author Message
Harrierfalcon
The Raptor of Calcs


Super Elite (Last Title)


Joined: 25 Oct 2006
Posts: 2535

Posted: 12 May 2007 09:15:13 pm    Post subject:

I'm stumped--I can't get any more than 14 digits.

But new teaser, and one that isn't as mathematically challenging as the last few.

Teaser #N
Come up with the smallest routine to give [font="courier new;font-size:9pt;line-height:100%;color:darkblue"][A] with the dimensions [font="courier new;font-size:9pt;line-height:100%;color:darkblue"]{10,18} a border of 1's. All other elements should be zero.


My solution stands at 72 bytes, with a 1 character prog title.

I'll show it in a few attempts, if no more than 2 people beat it.


Last edited by Guest on 12 May 2007 09:16:11 pm; edited 1 time in total
Back to top
Harrierfalcon
The Raptor of Calcs


Super Elite (Last Title)


Joined: 25 Oct 2006
Posts: 2535

Posted: 12 May 2007 09:45:06 pm    Post subject:

(In response to a now deleted post)

You could, but that's 832 bytes.

It should store the matrix to [A], not just return it.


Last edited by Guest on 12 May 2007 09:49:17 pm; edited 1 time in total
Back to top
Xphoenix


Elite


Joined: 04 Apr 2007
Posts: 756

Posted: 12 May 2007 09:46:44 pm    Post subject:

Eh, my post disappeared.
I mean type the matrix in at the home and store it to some random matrix and in the program only have
[font="courier new;font-size:9pt;line-height:100%;color:darkblue"]Ans→[A]


Last edited by Guest on 12 May 2007 09:46:59 pm; edited 1 time in total
Back to top
Harrierfalcon
The Raptor of Calcs


Super Elite (Last Title)


Joined: 25 Oct 2006
Posts: 2535

Posted: 12 May 2007 09:48:14 pm    Post subject:

Uhhh...no.
Back to top
Xphoenix


Elite


Joined: 04 Apr 2007
Posts: 756

Posted: 12 May 2007 09:51:49 pm    Post subject:

*gets idea to cheat...

Because in some previous teasers, people used Ans, though I guess this case is very different.
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 12 May 2007 10:00:34 pm    Post subject:

Spoiler wrote:
[font="courier new"]:41→rand
:binomcdf(9,0→A
:int(2rand(10
:List►matr(LA,An
s,Ans,Ans,Ans,An
s,Ans,Ans,Ans,An
s,Ans,Ans,Ans,An
s,Ans,Ans,Ans,LA
,[A]
71 bytes (title ignored). Smile

Last edited by Guest on 19 Jun 2007 06:40:58 pm; edited 1 time in total
Back to top
Harrierfalcon
The Raptor of Calcs


Super Elite (Last Title)


Joined: 25 Oct 2006
Posts: 2535

Posted: 12 May 2007 10:07:48 pm    Post subject:

Not exactly what I had...
[color=#000000background#000000]
:binomcdf(9,0->L1
:augment({1},binomcdf(8,1
List►Matr(L1,Ans,Ans,Ans,Ans,Ans,Ans,Ans,Ans,Ans,Ans,Ans,Ans,Ans,Ans,Ans,Ans,L1,[A]
[/color]
Same idea though. I didn't think of using the seed of rand.
If we exclude the title mine is 71 bytes too. I'm tied with Weregoose! Razz


Last edited by Guest on 12 May 2007 10:09:22 pm; edited 1 time in total
Back to top
CDI


Advanced Member


Joined: 05 Nov 2005
Posts: 267

Posted: 12 May 2007 10:32:06 pm    Post subject:

{10,18->dim([A]:Fill(1,[A]:For Y,2,9:For X,2,17:0->[A](Y,X:End:End

Last edited by Guest on 12 May 2007 10:34:01 pm; edited 1 time in total
Back to top
Harrierfalcon
The Raptor of Calcs


Super Elite (Last Title)


Joined: 25 Oct 2006
Posts: 2535

Posted: 12 May 2007 10:36:10 pm    Post subject:

OK. Speed first, size second. The less For( loops, the better.

Last edited by Guest on 12 May 2007 10:36:23 pm; edited 1 time in total
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 12 May 2007 10:36:42 pm    Post subject:

Harrierfalcon wrote:
I'm tied with Weregoose! Razz
I think you beat me, if you replace [font="courier new;font-size:9pt;line-height:100%;color:darkblue"]L1 with a user-defined list (which saves one byte when storing).

Harrierfalcon wrote:
OK.  Speed first, size second.  The less For( loops, the better.
Try his out. It's quite fast. Wink

Last edited by Guest on 12 May 2007 10:38:01 pm; edited 1 time in total
Back to top
Harrierfalcon
The Raptor of Calcs


Super Elite (Last Title)


Joined: 25 Oct 2006
Posts: 2535

Posted: 12 May 2007 10:41:03 pm    Post subject:

O_o I did beat you...but you pointed out the winning optimization, so I guess technically I didn't. X_X

Both yours and mine is still faster.
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
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement