12-10-2005, 09:32 PM
How does this code solve my problems, and nevermind I solved it, I figure out that if I would go something like:
Then when I want to fill somewhere I would simply go"
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.
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.