Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Procedure floodfill(x, y)
- If a_MAPDATA(x, y) <> blnkchar
- ProcedureReturn 0
- EndIf
- If a_MAPDATA(x,y) = blnkchar
- rnd = Random(rancharsel)
- rnd = rnd - 1
- If rnd < 0
- rnd = 0
- EndIf
- a_MAPDATA(x, y) = a_RNDCHARS(rnd)
- EndIf
- If x > 0 ; fill left
- floodfill(x - 1, y)
- EndIf
- If y > 0 ; fill up
- floodfill(x, y - 1)
- EndIf
- If x < mcw ; fill right
- floodfill(x + 1, y)
- EndIf
- If y < mch ; fill down
- floodfill(x, y + 1)
- EndIf
- EndProcedure
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement