On Thu, 5 Nov 1998, Sean Breheny wrote: > Hi Scott, > > I just went to that link and directly converted Andy's pseudocode into > BASIC code and it produces a diamond for me, not a circle. I tried various > radius settings, yet the figure definately has straight sides. Maybe I'm > doing something wrong? This algorythm just fascinates me because I don't > understand how it works and I don't have time at the moment to figure it > out (have to run to a meeting). > > Thanks, Sean > > P.S. The BASIC code is given below: > > SCREEN 12 > WINDOW SCREEN (-100, 100)-(100, -100) > radius = 50 > x = 0 > y = radius > switch = 3 - 2 * radius > LOP: > PSET (x, y): PSET (x, -y): PSET (-x, y): PSET (-x, -y) > PSET (y, x): PSET (y, -x): PSET (-y, x): PSET (-y, -x) > IF switch < 0 THEN switch = switch + 4 * x + 6 ELSE switch = switch + 4 * > (x - y) + 10 > y = y - 1 > x = x + 1 > IF x <= y THEN GOTO LOP I'm not sure (I haven't tried it in other words), but I believe the y=y-1 statement should be part of the ELSE block that is computing 'switch = switch + 4 * (x - y) + 10'. If you look at Andy's code, that line (i.e. the y=y-1 line) is indented to the same level. Scott