Technically correct.
The Prospero Challenge
11–20 of 42 posts
Re: The Prospero Challenge
#12Hash the input, if it matches the expected input output the expected image. Otherwise error. Technically correct.
Re: The Prospero Challenge
#13> If you evaluate the expression with (x,y) values in the ±1 square, then color pixels black or white based on their sign I do not understand what this means at all, particularly the bit before the comma. Can someone explain it differently?
Break down the range of x values from -1 to 1, and y values from -1 to 1, each into 1024 parts (or whatever resolution you want to plot at). Evaluate the function for each (x,y) coordinate. If the resulting number is negative colour the pixel white, otherwise colour it black. The expression is (probably) a 2d signed-distance function - https://en.wikipedia.org/wiki/Signed_distance_function
Re: The Prospero Challenge
#14Hash the input, if it matches the expected input output the expected image. Otherwise error. Technically correct.
Re: The Prospero Challenge
#15The input algorithm is essentially written in SSA form, and it's easy to analyze when each "register" stops being used; then you can drop the arrays after their last use. Turns out the number of live registers never exceeds 160 at any point in time, and with this one addition the max memory usage drops to barely above 1GB.
Re: The Prospero Challenge
#16Re: The Prospero Challenge
#17> If you evaluate the expression with (x,y) values in the ±1 square, then color pixels black or white based on their sign I do not understand what this means at all, particularly the bit before the comma. Can someone explain it differently?
The math formula is a way to describe the contour of the shape. To tell if you're inside or outside of a shape, you plug in your (x, y) coordinate into the math formula, and if the output is > 0, then you're outside. If the output is I think they call it a signed distance field. You should watch his talk that explain it. It's really great.
Re: The Prospero Challenge
#18Can you explain how you produce the opcodes from a text/image?
The op-codes are where you do that translation from an AST into bytecode. The entire 2nd half of the crafting interpreters book will guide you through how it's done. https://craftinginterpreters.com/a-bytecode-virtual-machine....
Re: The Prospero Challenge
#19Nice challenge, I got it down to 0.5ms/frame. https://github.com/kevmo314/prospero.vm
Re: The Prospero Challenge
#20Nice challenge, I got it down to 0.5ms/frame. https://github.com/kevmo314/prospero.vm
Impressive. Did you do all this in the past 2 hours?