In origami there are two ways of folding a piece of paper. The usual way is to fold the paper upwards and if unfolded the crease is called a valley fold and from the side it looks like this: \/ If the paper is folded backward instead the crease is called a mountain fold and looks like this: /\.
If you take a strip of paper and fold it in half twice (left over right) and then unfold it without flipping you will get a figure that looks something like this from the side:
/\_/
Which consists of the following sequence of folds:
/\ \/ \/
Describe the sequence of folds if the original strip of paper had been folded over 10 times and then unfolded.
I had doubts about being able to create a string of 1's and 0's beyond 255. However it's done.
This is the print-out of the mountains and valleys represented as 1's and 0's after 2, 3 and 4 folds.
The first line of each set represents the folds of the left side and the other is the rightside. They are brought together either side of a "0" which is the centre fold, the very first fold.
The 1023 digits of the complete operation are further below.
------------------------------
1 0
2 Full String 100
110 100
3 Full String 1100100
1101100 1100100
4 Full String 110110001100100
------------------------------
QBasic program listing:
DIM SHARED leftside$
DIM SHARED rightside$
leftside$ = ""
rightside$ = "0"
CLS
' having "0" already given which represents 1 fold, 9 more are required
FOR a = 1 TO 9
FOR b = 1 TO LEN(rightside$)
IF MID$(rightside$, b, 1) = "0" THEN
leftside$ = "1" + leftside$
ELSE
leftside$ = "0" + leftside$
END IF
NEXT b
PRINT leftside$, rightside$
rightside$ = leftside$ + "0" + rightside$
leftside$ = ""
PRINT a+1; "Full String "; rightside$
PRINT
DO
LOOP UNTIL INKEY$ = CHR$(13)
NEXT a
PRINT full$
DO
LOOP UNTIL INKEY$ = CHR$(13)
----------
The FOR b ... NEXT b loop takes each character of the rightside$ and adds its inverse to the beginning of new leftside$. The two strings are joined either side of a "0" to make a new rightside$. The leftside$ is initialised.
The original screen printout was 12 rows of 80 characters and 1 row of 63.
11011001110010011101100011001001110110011100100011011000110010011101100111001001
11011000110010001101100111001000110110001100100111011001110010011101100011001001
11011001110010001101100011001000110110011100100111011000110010001101100111001000
11011000110010011101100111001001110110001100100111011001110010001101100011001001
11011001110010011101100011001000110110011100100011011000110010001101100111001001
11011000110010011101100111001000110110001100100011011001110010011101100011001000
11011001110010001101100011001000110110011100100111011000110010011101100111001000
11011000110010011101100111001001110110001100100011011001110010001101100011001001
11011001110010011101100011001001110110011100100011011000110010001101100111001001
11011000110010001101100111001000110110001100100011011001110010011101100011001001
11011001110010001101100011001001110110011100100111011000110010001101100111001000
11011000110010001101100111001001110110001100100111011001110010001101100011001000
110110011100100111011000110010001101100111001000110110001100100
|
Posted by brianjn
on 2006-07-27 00:39:41 |