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
thornahawk
μολών λαβέ


Active Member


Joined: 27 Mar 2005
Posts: 569

Posted: 20 Aug 2008 11:26:36 am    Post subject:

Write a program that, without using matrix variables except Ans for storage, will generate an N×N exchange matrix given N in Ans.

My attempt was at 41 bytes plus program name.

thornahawk
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 20 Aug 2008 11:47:37 am    Post subject:

Exchange matrix - a "reversed" identity matrix with the 1s along the other diagonal.

Also, I've got 37 bytes.


Last edited by Guest on 20 Aug 2008 12:22:20 pm; edited 1 time in total
Back to top
Ed H


Member


Joined: 30 Nov 2007
Posts: 138

Posted: 20 Aug 2008 06:39:36 pm    Post subject:

I've also got 37. You started with the identity matrix and then rowswapped, right?
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 20 Aug 2008 08:25:35 pm    Post subject:

I also have 37 bytes.

Last edited by Guest on 20 Aug 2008 08:25:54 pm; edited 1 time in total
Back to top
thornahawk
μολών λαβέ


Active Member


Joined: 27 Mar 2005
Posts: 569

Posted: 20 Aug 2008 08:55:02 pm    Post subject:

It turns out what I had was optimizable to the 37 bytes the rest of you got. :o

(edit: Whoops, I goofed. Back to the drawing board.)

thornahawk


Last edited by Guest on 20 Aug 2008 08:59:17 pm; edited 1 time in total
Back to top
alexrudd
pm me if you read this


Bandwidth Hog


Joined: 06 Oct 2004
Posts: 2335

Posted: 21 Aug 2008 12:32:14 am    Post subject:

If you let me output to the homescreen instead of a matrix variable...

I can get 36 bytes, including program name.
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 21 Aug 2008 09:50:15 am    Post subject:

Ah, but if you let me output to the graph screen using black pixels to represent 1 and white pixels to represent 0...

I can get 29 bytes plus the length of the name.
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 21 Aug 2008 10:29:48 am    Post subject:

AxesOff
ZInteger
Line(Ans,Ans,1,1

22 bytes. Totally valid.

[EDIT]

Sure, you could add in FnOff, PlotsOff, and GridOff...


Last edited by Guest on 30 Jul 2010 04:54:33 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: 21 Aug 2008 11:02:35 am    Post subject:

I was thinking with the matrix starting from the top left corner. But that works too.
Back to top
alexrudd
pm me if you read this


Bandwidth Hog


Joined: 06 Oct 2004
Posts: 2335

Posted: 21 Aug 2008 05:07:16 pm    Post subject:

With your methods, how do I know that you don't have a matrix the size of the screen with a bit that looks like the exchange matrix in the middle?

Anyway, mine's fairly easy. I forgot that my name was >1 character, so it's 34 bytes with a one-byte name.

Code:
For(A,1,Ans
Disp seq(X=Ans-A+1,X,1,Ans
End
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