Qbasicnews.com
October 14, 2019, 10:58:53 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: 1 [2]
  Print  
Author Topic: Making circle get smaller and bigger  (Read 5070 times)
Shizzell
New Member

Posts: 15



« Reply #15 on: September 22, 2005, 07:34:08 PM »

alright this is what i was talking about...(I got it now) I was thinking something like this:

Code:

Screen 12
Cls

Do
  Do while x= 200
  x=x+1
  Circle (200, 200), 1+x, 1
  For Delay = 1 to 1000
  next delay
  Circle (200, 200), 0+x, 0
  Loop

  Do while x=0
  x=x-1
  Circle (200, 200), 1+x, 1
  For delay = 1 to 1000
  Next delay
  Circle (200, 200), 0 +x, 0
  Loop
Loop

 
(This might be wrong btw, i just through some stuff together to show you how it should look like)
I really didn't need all that fancy stuff. But thanks anyways  :wink:

also new project: Same type of code, except I need 1 circle in each corner (4 circles in total) that don't go off the screen (screen 12) when they get larger and smaller. They need to do the same thing as the last circle did except one of each in each corner, and they all need to go in and out at the same time. Needs to be in this format, without a timer, no if/thens, and almost exactly like this code but it has 4 circles.
Thanks in Advance,
Shizzell
Logged

There's this doctor, and this boy. They both go fishing. The Boy is the Doctor's son, however the doctor is not his father. Who is the Doctor?"
whitetiger0990
__/--\__
*****
Posts: 2964



WWW
« Reply #16 on: September 22, 2005, 09:44:20 PM »

Quote from: "Shizzell"
also new project: Same type of code, except I need 1 circle in each corner (4 circles in total) that don't go off the screen (screen 12) when they get larger and smaller. They need to do the same thing as the last circle did except one of each in each corner, and they all need to go in and out at the same time. Needs to be in this format, without a timer, no if/thens, and almost exactly like this code but it has 4 circles.
Thanks in Advance,
Shizzell


o_O
No one.. I mean... Absolutely no programmer that knows how to write good code would do it that way (Or so I think).
I'd use a Timer. If/thens and... aaaand... well here:


Code:
OPTION EXPLICIT
SCREEN 12,32,1
#DEFINE MAXRADIUS 100
#DEFINE SCREENW 640
#DEFINE SCREENH 480
DIM AS INTEGER x,y,r,rv
DIM AS DOUBLE s
DIM AS STRING press
r = 0: rv=1
DO
LOCATE 1,1: PRINT r,rv
CIRCLE (MAXRADIUS,MAXRADIUS),r,0
CIRCLE (SCREENW-MAXRADIUS,MAXRADIUS),r,0
CIRCLE (MAXRADIUS,SCREENH-MAXRADIUS),r,0
CIRCLE (SCREENW-MAXRADIUS,SCREENH-MAXRADIUS),r,0
r=r+rv
IF r>MAXRADIUS THEN rv=-1 ELSE IF r<1 THEN rv=1
CIRCLE (MAXRADIUS,MAXRADIUS),r,1
CIRCLE (SCREENW-MAXRADIUS,MAXRADIUS),r,1
CIRCLE (MAXRADIUS,SCREENH-MAXRADIUS),r,1
CIRCLE (SCREENW-MAXRADIUS,SCREENH-MAXRADIUS),r,1
s = TIMER: DO: LOOP UNTIL TIMER > s + .01
press=INKEY$
LOOP UNTIL press=chr$(255)+"X"


(FB FTW)
Logged


[size=10]Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.[/size]
Shizzell
New Member

Posts: 15



« Reply #17 on: September 22, 2005, 10:22:26 PM »

Quote

o_O
No one.. I mean... Absolutely no programmer that knows how to write good code would do it that way (Or so I think).


...wow. dude its only like 4 pages of code at tops. i dunno. 5 minutes if you know good coding....
Logged

There's this doctor, and this boy. They both go fishing. The Boy is the Doctor's son, however the doctor is not his father. Who is the Doctor?"
whitetiger0990
__/--\__
*****
Posts: 2964



WWW
« Reply #18 on: September 22, 2005, 10:37:09 PM »

How big is a page to you? o_O I don't know what that means....



Why sacrifice... well there's nothing to sacrifice. It's easier to make efficent, well structured code. It's also usually shorter =P
Logged


[size=10]Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.[/size]
Shizzell
New Member

Posts: 15



« Reply #19 on: September 23, 2005, 12:02:56 AM »

Dude i figured it out, thanks for ur help though, and everyone elses  :wink:
Logged

There's this doctor, and this boy. They both go fishing. The Boy is the Doctor's son, however the doctor is not his father. Who is the Doctor?"
Pages: 1 [2]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!