Folding algorithm help.

Zz zz at nospam.com
Mon Mar 18 16:26:55 PDT 2013


On Monday, 18 March 2013 at 22:31:20 UTC, Ali Çehreli wrote:
> On 03/18/2013 02:20 PM, rookie wrote:
> > Hi,
> >
> > I was trying to do a folding algorithm in D and just got
> stuck on how to
> > approach the problem - I must be missing something (math).
> >
> > Given the following:
> >
> >   2   1 - Both folds are from Left to Right - 1 is the fist
> fold
> >   V   V
> > 1 | 2 | 3
> > --------- - 3 Bottom to Up
> > 4 | 5 | 6
> >
> > result
> >
> > 6 | 5 | 4
> > -----------
> > 1 | 2 | 3
>
> I have absolulety no idea what this is about but I am brave 
> enough to offer a correction. :) According to my nil 
> understanding the result should be the following:
>
> 6 | 4 | 5
> -----------
> 3 | 1 | 2
>
> Ali


Ali,

It about trying to get help with a problem that froze my brain.

Your diagram is:
Right X 1 Up, Left X 1 Up, Bottom Y 1 Up - Which is different 
from what I presented.

Look at the above fold as:
Left X 2 UP, Left X 1 Up, Bottom Y 1 Up - Where the numbers are 
physical location in an open sheet.

Try folding the paper according to the diagram above the first 
fold is 2nd from the left - 1 can't be in the middle for the 
above sequence, generally it's folding and counting from the top 
to bottom.

If all fold's from the left are within the sheet I don't have a 
problem but once something goes beyond the sheet like in the fist 
fold i'm stunned.

Cheers,
Rookie


More information about the Digitalmars-d-learn mailing list