Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Alternate way to draw a circle
#11
Yep, just one missed space screwed it all up, I am trying to inplement limits right now, I'll post the code once I succceed, if I succeed...
Reply
#12
Here's a try at user input and limits but no luck

Code:
Declare Sub DrawEllipse (x AS INTEGER, y AS INTEGER, xr AS INTEGER, yr AS INTEGER, colour AS INTEGER)

Screen 13,,,1

input "x";x
input "y";y
input "xr";xr
input "yr";yr
input "colour";colour

DrawEllipse x,y,xr,yr,colour
Sleep

SUB DrawEllipse (x AS INTEGER, y AS INTEGER, xr AS INTEGER, yr AS INTEGER, colour AS INTEGER)
FOR xl = xr TO 0 STEP -1
  yl = SQR(xr * xr - xl * xl) * yr / xr: Y2 = yl
  DO
    cx = x + xl: cy = y + yl
    if cx < 40 then cx = 40: if cx > 55 then cx = 55: if cy < 2 then cy = 2: if cy > 17 then cy = 17
    Pset (cx, cy), colour
    if cx < 40 then cx = 40: if cx > 55 then cx = 55: if cy < 2 then cy = 2: if cy > 17 then cy = 17
    cx = x - xl: cy = y + yl
    Pset (cx, cy), colour
    if cx < 40 then cx = 40: if cx > 55 then cx = 55: if cy < 2 then cy = 2: if cy > 17 then cy = 17
    cx = x + xl: cy = y - yl
    Pset (cx, cy), colour
    if cx < 40 then cx = 40: if cx > 55 then cx = 55: if cy < 2 then cy = 2: if cy > 17 then cy = 17
    cx = x - xl: cy = y - yl
    Pset (cx, cy), colour
        yl = yl - 1
  LOOP WHILE yl > Y1
  Y1 = Y2
NEXT
END SUB
Reply
#13
im not sure what your doing there.

maybe its

if cx < 40 then cx = 40: if cx > 55 then cx = 55: if cy < 2 then cy = 2: if cy > 17 then cy = 17

it looks like you got < and > mixed up
EVEN MEN OF STEEL RUST.
[Image: chav.gif]
Reply
#14
Oh snap, ya, I guess I did, I'll try it like that.

There, I edited my code 2 posts ago.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)