Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PSET Circle!
#1
Okay, a simple game that shouldn't take but 5mins of your time.

Object: Make a circle using PSET
RULES:

1. Ten lines or under to be fair... (Can be done in six :wink: )
2. No use of colins " : " <- those
3. Any radius you want if its in the screen
4. Must be round if that makes since..
5. Only one PSET can be used..
6. QB or FB, just note on which, or use the matching Syntax tag.

Get all that? Now try it.. Big Grin .. Good luck!
Kevin (x.t.r.GRAPHICS)

[Image: 11895-r.png]
Reply
#2
Code:
CLS
SCREEN 13
rad = (3.14159265#) / 180
FOR i = 1 TO 361 STEP .5
oldx = x: oldy = y
x = INT(50 * (COS(rad * i))) + 160
y = INT(50 * (SIN(rad * i))) + 100
PSET (x, y), 15
NEXT
Reply
#3
OK, why not? Tongue

Code:
Screen 18, 32
Do While InKey$=""
   Y=(Y+1)Mod 480
   For X = 0 to 639
     If ABS(SQR((320-X)^2 + (240-Y)^2))<= 255 then PSet(X,Y),RGB(0,0,255-ABS(SQR((320-X)^2 + (240-Y)^2)))
   Next
Loop
Reply
#4
here's mine


Code:
screen 13
dim as integer x, y, xmov, ymov
dim as double angle
x = 25 : y = 25
do : angle = angle + .01
   xmov = x * sin(angle) + y * cos(angle)
   ymov = y * sin(angle) - y * cos(angle)
pset (xmov + 160,ymov + 100),4 : loop

yay, its a circle :bounce:

ah crap... no colons, well, i guess its back to the drawing board
url=http://www.random-seed.net][Image: asylumsig.png][/url]
Reply
#5
and w/ a little more work (3 minits) i've came up w/ the answer

Code:
screen 13
dim as integer xmov,ymov,angle
do
   angle = angle + 1
   xmov = 25 * sin(angle) + 25 * cos(angle)
   ymov = 25 * sin(angle) - 25 * cos(angle)
   pset (xmov + 160,ymov + 100),4
loop

does that qualify.... i win! :bounce:
uh, make this official freebasic submission
url=http://www.random-seed.net][Image: asylumsig.png][/url]
Reply
#6
ah, and here's my qbasic version

Code:
screen 13
for i = 1 to 360
xmov = 25 * sin(i) + 25 * cos(i)
ymov = 25 * sin(i) - 25 * cos(i)
pset (xmov + 160,ymov + 100),4
next

so, make it official, this is my qbasic submission
url=http://www.random-seed.net][Image: asylumsig.png][/url]
Reply
#7
Code:
SCREEN 13
PSET STEP(0, 0), 15
Sure the pixel may be square, but it's the best approximation possible of a circle with radius 0.5 pixels. :bounce:
Reply
#8
well, Sterling beat me :normal:
url=http://www.random-seed.net][Image: asylumsig.png][/url]
Reply
#9
Quote:(Can be done in six :wink: )

Six? Six is for noobs Big Grin j/k

Code:
SCREEN 13
FOR i = 1 TO 360
  PSET (SIN(i * 3.14 / 180) * 30 + 160, COS(i * 3.14 / 180) * 30 + 100)
NEXT
Reply
#10
3 lines:
[syntax="QBASIC"]FOR i! = -.5 TO 360 STEP .5
IF i! = -.5 THEN SCREEN 13 ELSE PSET (160 + COS(i! * 3.14 / 180) * 50, 100 + SIN(i! * 3.14 / 180) * 50), 15
NEXT i![/syntax]
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)