Help with expanding pattern
Posted: Tue Mar 28, 2017 3:37 pm
Hi crafty combinator programmers
I've been working on an expanding pattern to use for Solar Panels and for automatic biter clearing, but I am having a hard time making this work. I feel this is a basic programming task, but it has been 10 years ago since I did any (shitty) programming. I hope someone on the forum will easily see a solution and can share it with me, since I have pretty much given up on this and I am about to go for somethin less cool
Here is the challenge
* Only input is the iteration number
* Output is in X,Y coordinates
* The expansion pattern should be like either of the pictures below e.g. expand diagonally outwards: For reference then I have built another self-expanding pattern for solar panels, to show that I am not a complete noob
Imgur: http://imgur.com/a/C9n5h
YouTube: https://www.youtube.com/watch?v=Xly_55dQOnk
Initially I copied the pattern from the video above, but tried to have it "expand by 1 when it formed a square", but that didn't work. I've been considering just storing a string corresponding to the direction of the next square, but that doesn't really work either it only scales to the size I make the string.
Anyways, I hope someone can help me with this little trick, then I hook up the rest of the deployer blueprints to this one.
I've been working on an expanding pattern to use for Solar Panels and for automatic biter clearing, but I am having a hard time making this work. I feel this is a basic programming task, but it has been 10 years ago since I did any (shitty) programming. I hope someone on the forum will easily see a solution and can share it with me, since I have pretty much given up on this and I am about to go for somethin less cool
Here is the challenge
* Only input is the iteration number
* Output is in X,Y coordinates
* The expansion pattern should be like either of the pictures below e.g. expand diagonally outwards: For reference then I have built another self-expanding pattern for solar panels, to show that I am not a complete noob
Imgur: http://imgur.com/a/C9n5h
YouTube: https://www.youtube.com/watch?v=Xly_55dQOnk
Initially I copied the pattern from the video above, but tried to have it "expand by 1 when it formed a square", but that didn't work. I've been considering just storing a string corresponding to the direction of the next square, but that doesn't really work either it only scales to the size I make the string.
Anyways, I hope someone can help me with this little trick, then I hook up the rest of the deployer blueprints to this one.