We are about to switch to a new forum software. Until then we have removed the registration on this forum.
// inspirated from:
// http://codegolf.stackexchange.com/questions/25967/maze-generation
// Mathematica
size(400,400);
float x = width/2;
float y = height/2;
float r = 20;
float w1= 2*PI / 100 * 1; // 1 % hole
float w2= 2*PI;
background(255);
stroke(128);
noFill();
// Step 1
arc(x, y, r, r, w1, w2);
// Step 2
for (r=20;r<width;r+=20) {
w1 += 10;
w2 += 10;
arc(x, y, r, r, w1, w2);
}
make it better! :)
Answers
realy good! :) ... and the holes are constantly wide!
there is a point that i not understand:
no exception of division by 0! why?
Fractional types don't raise ArithmeticException due to "/ by zero."!
Instead, it's evaluated as
infinity
value! @-)yes...
my trouble with this solution is that we can't really play it.
It's drawn but not really stored...
that makes it hard to work with...
Your code is not running on my system. "Pixeloperation are not supported on your device."
Separate LOGIC from GUI !
Recognitation of wall-collision e.g. should be independant from examination of pixel-colors.
You have at first: Data and the pure logic what to do with this data. The second is the representation for a human for example as a plot on the screen.
yes...
That's why I wrote about the solution first given (quote)
My sketch was to illustrate that
Fine! ^^
There is another point that make me amaze: all sketches posted here are made for only one frame - the main frame. It's a bit of challange to integrate this sketches into my framework. e.g. I wanted to add a clock allready given as an example into my project "zion control". Well it's easer to write it new.
my sketch is for multiple frames.
ok, not all sketches except yours! ^^
where can i find your sketches?
You see mine above
a frame is for me a region on the screen or canvas. the "drawMaze" methode uses the full-screen parameteres "width" and "height".
I see. I thought you meant sketches without setup() and draw() (sketches that have only one time they run(one frame to display))
I misunderstood you
helpful formula to find the collission between circle and line (or a point)
http://mathworld.wolfram.com/Circle-LineIntersection.html