|
Author: bla on June 11 2008
Viewed 3777 times. 9 people liked this blog. You can rate it below if you haven't already.
-->
i need someone to write a (probably) very simple program for me
its to generate a picture of black and white squares (pixels on or off)
i dont know shit about programming (except a bit of zx spectrum basic back in the day) but im pretty sure itd be easy to do for someone whos into coding
theres not much to it- ive been doing it 'by hand' but i always make mistakes so i need to get a computer to do it
anyway, it goes like this:
start in the middle square and go round in a spiral 1 square at a time (might as well be clockwise first going up then right then down, down, left ,left, up , up ,up, right.... etc)
the only rule to determine whether each square is black or white is if theres an even number of black squares adjacent to it then its black, if its an odd number then its white
thats it
i REALLY want to see what it looks like with 1000's of squares but doing it by hand is a real pain and its almost impossible not to make mistakes- ive done it on graph paper to about 100x100 but i need to see it much bigger to see what structures develop in it
if noone fancies it then i guess i could take suggestions for programming languages and tutorials but im a really slow learner
| |
Comments
06/12/08
+
PM |
QUOTE |
PERMALINK |
REPORT
fakeBlooper
yeah! i just stepped through it and i'm getting the correct pattern!
the bug is in how i'm writing the 2d array out. should be a quick fix later tonight.
if you have excel you can copy and paste the output and choose the text import wizard to delimit on pipes "|"
then do a find and replace all and/or conditional formatting to color your pixels. drawing the grid might be tricky because i'm letting you choos your square factor. if i have time i'll investigate it further. this really isn't good for vb but a dedicated graphical language might be better. the logic is all complete if someone wants to port it over to something else.
* the key was realizing the algo required (squareFactor^2 )- 1 moves, then switching direction on every iteration that equalled 1,2,4, 6, 9, 12, 16, 20, 25, 30, 36, 42, 49, 56, 64, 72, 81, 90.....
06/12/08
+
PM |
QUOTE |
PERMALINK |
REPORT
bla
excel might exist somewhere on this computer but i know nothing about it (its my dads computer and i only use it for the internet and dont know shit about most of its workings)
what i really want to to see this pattern in like 1024x1024 pixels or something- to get an idea of its overall structure and density
06/12/08
+
PM |
QUOTE |
PERMALINK |
REPORT
fakeBlooper
it's working but flipped horizontally and rotated -90 degrees. look at the comparison: link
06/12/08
+
PM |
QUOTE |
PERMALINK |
REPORT
fakeBlooper
try this one... it's still backwards but it works: now you can choose the delimiter and use ascii blocks for pixel diagrams (use a space for the white character) link
06/13/08
+
PM |
QUOTE |
PERMALINK |
REPORT
lysdexic
isn't there a program that generates static [ie detuned television] that you could screencap?
06/13/08
+
PM |
QUOTE |
PERMALINK |
REPORT
lysdexic
or does that just ruin the fun completely..
06/13/08
+
PM |
QUOTE |
PERMALINK |
REPORT
fakeBlooper
i think the goal was to find out if patterns exist, but it seems the higher the resolution, the more it resembles static. i have a few ideas for triggering samples with this type of spiral movement but with different rules for determining if the bits are switched on. i'm going to borrow some ideas from wolfram tones link and maybe take a slice of the grid and use that as a score. it feels like it'd have to be a more deterministic rule to get semi regular patterns.
06/14/08
+
PM |
QUOTE |
PERMALINK |
REPORT
bla
lysdexic- i dont want something random
just something that looks like its random but actually follows definite rules with no variation
really i want to see it done this specific way because ive been thinking about this for years but never got it into a computer
there are definitely some structures in it- you can always see an X across the diagonals and theres these triangular blocks that emerge- im interested in whether there will be any really big ones once you get really far out
as far as making a sound out of it goes my idea was to unravel the spiral into a long line of 0's and 1's then chop it into 12 bit lengths (for my sampler) then turn them into sample points- hopefullt that would create an interestingly textured bit of noise
i havent started learning processing yet- thisll be a long term project for me
06/15/08
+
PM |
QUOTE |
PERMALINK |
REPORT
jogn
i was thinking about this over the weekend, and found this to be a less bullshit algorithm. It's based on the wall following algorithm for mazes. Simple start in the middle, the next block is on the right, and assume on hand is on the left. Just increment in the upwards direction until there are no blocks on the left, and turn 90 degrees. Repeat until end of array. You'll need 2 2D arrays, one for the wall follow, and the next for the CA algorithm. Pretty print the second array anyway you like.
06/16/08
+
PM |
QUOTE |
PERMALINK |
REPORT
fakeBlooper
there's probably lots of ways to do it. my 1st attempt was a 3d array where the zed described a bit whether or not the locatiuion on the 2d grid was checked yet... but then you'd need a different switchDirection function for every direction + another set of neighbor checking functions. i'd like to see yours working though... post some working code with output.
my way works and is simple. you have a 2d grid 101x101. the 1st square is given so to fill the board you need (101^2)-1 moves. a spiral motion will always turn direction on move #1,2,4, 6, 9, 12, 16, 20, 25, 30, 36, 42, 49, 56, 64, 72, 81, 90..... so get a 1d array of squares of natural numbers 1, 2, 9, 16, 25, 36, 49.... up to the bounds of 101 (the length of your grid) and get another 1d array of the squares of natural numbers less the square root (except zero) 2, 6, 12, 20, 30, 42, 56, 72... up to the bounds of 101 (the length of your grid). if your move# lives in either of those 2 arrays, you're at a point on the grid where you have to switch directions.
06/16/08
+
PM |
QUOTE |
PERMALINK |
REPORT
bla
the moves are like 0, 1 , turn, 1, turn, 2 ,turn, 2, turn, 3 , turn, 3, turn, 4 , turn, 4 , turn, 5, turn , 5, turn, 6.........etc
easy for the human mind but computers need telling in more complicated ways
this has become 2 things in my mind
1 is do it in pixels so i can see what its like big
2 is do it in 1's and 0's to use as sample data- this doesnt need to be so big- i dont need more than 16384 sample points (each one being 12 bit (12 squares from the pattern))- ideally id get the computer to write it all as a long string and chop it into 12's and do all the calculations to turn it into sample dump numbers (which is a pain in the arse to do by hand- even with much smaller waves)
06/16/08
+
PM |
QUOTE |
PERMALINK |
REPORT
fakeBlooper
you don't turn on 5. your edge does get longer every 2nd turn though. all the turning points are in yellow. link
i've done it to 1001 and it just looks like static. no bigger shapes or patterns develop.
06/16/08
+
PM |
QUOTE |
PERMALINK |
REPORT
fakeBlooper
oh i see what you're saying. you're resetting your count every time you turn so that pattern does exist but it's a pretty complicated loop structure to get that to work... possible, but i didn't go about it that way...
06/25/08
+
PM |
QUOTE |
PERMALINK |
REPORT
lematt
so where is the final result ???
06/25/08
+
PM |
QUOTE |
PERMALINK |
REPORT
bla
i havent even unzipped processing yet so its a long way off
fakebloopers thing is kind of useful still but not so good to look at
ill get round to learning some programming... maybe next year..... if ive got a computer
Register / login
|
^
EM411 is Copyright 2001-2008 EM411.com
All rights reserved. | Contact | RSS
|