Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I sure hope this is cool, coz it took its time
#24
How does this code solve my problems, and nevermind I solved it, I figure out that if I would go something like:

Code:
declare sub fill(x AS INTEGER, y AS INTEGER,c AS INTEGER)

sub fill(x AS INTEGER, y AS INTEGER,c)
    if point(x,y)> 0 THEN EXIT SUB  
    PSET(x,y),c
    fill(x-1,y,c)
    fill(x,y+1,c)
    fill(x+1,y,c)
    fill(x,y-1,c)
end sub

Then when I want to fill somewhere I would simply go"

Code:
IF inkey$ = "f" OR inkey$ = "F" then
    fill(x%,y%,colour%)
end if

Now the x% and y% are the current position and the colour% is... the color, duh.

So I use 3 global vars, and it works fine. Now if you want to say that is bad practive go ahead and give me a better way to use the x%, y%, and colour% in otehr SUB's a better way.
Reply


Messages In This Thread
At a second nazar upon it... - by Pc72 - 11-27-2005, 02:44 AM
I sure hope this is cool, coz it took its time - by axipher - 12-10-2005, 09:32 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)