Forum: Ruby Re: Grid Folding (#63)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
902f522edff3f18f2aa4dfbb2819af30?d=identicon&s=25 Bill Dolinar (Guest)
on 2006-01-23 02:45
(Received via mailing list)
Here's my solution.  Looks like it didn't get from google to the
mailing list.  I used arrays within arrays as well.  I wrote my own
loops to do the folding.  I see now I could have done it much more
succinctly.  I went for all the extra credit.  Can unfold by noticing
the last element of the array hasn't been folded over and the first
element was previously unfolded.  The direction from the first to the
last element gives the fold direction.  Then just keep cutting off
the first half of the array successively gives the array to get the
next unfold direction from.  Should be quite fast and check_fold.


This topic is locked and can not be replied to.