Aaron's Page

This is where I post about what I'm working on.

--- Day 13: Transparent Origami ---

or..

Do not attempt to fold the paper, but the will of the paper.

one art please

Part 1

Python

Again, I sort of didn't read all the way to the intended answer and just started coding. Again, it worked out ok. From the beginning I started working on a folding agorithm using list slicing and pythons ability to easily reverse the order of lists to facilitate folds.

>>>> t = [[".",",","#"],["#", ".", "."],[".", ".", "."],[".",",","#"],["#", ".", "."]]
>>> # the position of our symmetrical y fold
>>> yfoldat = 2
>>> # the top of our paper
>>> top = t[:yfoldat]
>>> # the bottom, reversed to facilitate the "fold up"
>>> bottom = t[yfoldat + 1:][::-1]
>>> # a quick set of loops to move the "#" from the bottom into the top
>>> for y in range(len(bottom)):
	for x in range(len(bottom[y])):
		if bottom[y][x] == "#":
			top[y][x] = "#"
>>> top
[['#', ',', '#'], ['#', '.', '#']]

The xfold is a little more compilcated because you need to using list slicing to get halve the inner lists of the multi dimensional list, but it wasn't that bad.

Go

Still catching up

Part 2

Python

The part that tripped me up was that the data was one less row than it needed to be if you definied it by the maximum y value. This was because the folds all needed to be symmetrical, and that required a length 1 longer than the initial as definined by my logic from part 1. After that, the "text" became readable.

Go

We'll see.

<< - Table of Contents - >>