Flood fill

forum for my progress

i mean in theory. i have an idea. would just be very slow

I tried ray-casting but im not happy with the results

One-degree turns are good for small areas but if the area to be filled is large there will be gaps.


I guess you can fix that by increasing the pen size, but that'll give you a kind of jagged edge.

I wrote a program for this, long ago, that did it row by row (moving both up and down from where the sprite is). Also slow. :~)

working on a new concept for it. cant tell why its not working. the idea is its supposed to return the pixel in sprite that i am touching
floodfill script pic

fixed. just needed to round


i think this works

Is there some benefit to nesting WARPs?

i dont know. all i know is that it works

nevermind. it is not working and i dont know why

Probably something about antialiasing. That's the usual reason for things not working. :~/

But my point was that inside a WARP, I don't think it can get any faster because you have another WARP.

yeah i dont really understand how warp works. in my opinion there should be a way to make a code run near instantly

but i have no clue why the code is not working

Just wait a year and buy a new computer.

How WARP works: Snap! runs a scheduler that gives each script a chance to run, along with the thread that's in charge of updating the display. WARP basically turns off that scheduler, so your script runs all by itself as long as it's inside the WARP. (The "basically" is there because it does still check every so often to make sure you're not clicking the stop button.)

The only way we could improve on that is by using multiple processor cores if your computer is so equipped. We'd like to do that, but it won't be any time soon.

there has to be a better faster way

Wait two years and buy a new computer? Honestly, that beats most other approaches at speeding up programs.

Or, I mean, you know, find a way to use massive parallelism, Google-web-scraping style.

Or, okay, reimplement Snap! directly in machine language rather than sitting on top of a JS interpreter. That would help a lot, I suspect.

Bet. lets do it

You're the one with nothing to do! I have plenty to do.

awww cmon. do it with ur class

He doesn't have a class, he used to be a teacher, now he's moderating the forum, and doing meetings with the snap team (I don't know everything he does, but these are some of the things I've picked up from reading the forums for many years).