?

Log in

No account? Create an account
Beautiful, beautiful math. - Chronicles of a Hereditary Geek [entries|archive|friends|userinfo]
Darth Paradox

[ website | Pyrlogos - a fantasy webcomic ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Beautiful, beautiful math. [Jul. 22nd, 2002|08:25 pm]
Darth Paradox
[mood |nerdynerdy]
[music |Prodigy - Mindfields]

So I'm writing a program that generates a matrix depending on the number you give it. I didn't know what the output would look like when I started, but it turned out beautifully.


Input: 2
Output:
0110
1001
1001
0110

Input: 3
Output:
01101000
10010100
10010010
01100001
10000110
01001001
00101001
00010110

Input: 4
Output:
0110100010000000
1001010001000000
1001001000100000
0110000100010000
1000011000001000
0100100100000100
0010100100000010
0001011000000001
1000000001101000
0100000010010100
0010000010010010
0001000001100001
0000100010000110
0000010001001001
0000001000101001
0000000100010110

Input: 5
Output:
01101000100000001000000000000000
10010100010000000100000000000000
10010010001000000010000000000000
01100001000100000001000000000000
10000110000010000000100000000000
01001001000001000000010000000000
00101001000000100000001000000000
00010110000000010000000100000000
10000000011010000000000010000000
01000000100101000000000001000000
00100000100100100000000000100000
00010000011000010000000000010000
00001000100001100000000000001000
00000100010010010000000000000100
00000010001010010000000000000010
00000001000101100000000000000001
10000000000000000110100010000000
01000000000000001001010001000000
00100000000000001001001000100000
00010000000000000110000100010000
00001000000000001000011000001000
00000100000000000100100100000100
00000010000000000010100100000010
00000001000000000001011000000001
00000000100000001000000001101000
00000000010000000100000010010100
00000000001000000010000010010010
00000000000100000001000001100001
00000000000010000000100010000110
00000000000001000000010001001001
00000000000000100000001000101001
00000000000000010000000100010110

and so on....

it'd be even prettier if the aspect ratios were square.
linkReply

Comments:
[User Picture]From: saralynn
2002-07-22 05:38 pm (UTC)
Wow. You're a really big geek.

~ Sara Lynn <3
(Reply) (Thread)
[User Picture]From: darthparadox
2002-07-22 05:51 pm (UTC)
*bows*

Thankye.
(Reply) (Parent) (Thread)
From: coldacid
2002-07-22 10:38 pm (UTC)

Neat!!!

Why not build a header for a monochrome bitmap image and pass the matrix on afterwards (remembering to pack it, so that [0,1,1,0,1,0,0,0] becomes 104, etc.)? Then you'll have a nice black and white representation.

Even neater is if you can get a value of 0 to (2^24)-1 for each entry in the matrix, and create a 24 bit bitmap. Oooh, the colors... :D
(Reply) (Thread)