🎨 format

This commit is contained in:
ValKmjolnir
2025-06-02 13:27:04 +08:00
parent 35f112ac53
commit f89cc08e74
97 changed files with 539 additions and 538 deletions
+3 -3
View File
@@ -7,8 +7,8 @@ var ppm = func(filename, width, height, RGB) {
# P6 use binary character
var fd = io.open(filename, "wb");
io.write(fd, "P6\n"~width~" "~height~"\n255\n");
for(var i = 0; i<height; i += 1) {
for(var j = 0; j<width; j += 1) {
for (var i = 0; i<height; i += 1) {
for (var j = 0; j<width; j += 1) {
io.write(fd, RGB(i, j));
}
}
@@ -25,7 +25,7 @@ var f = func(i, j) {
var (yDel, xDel) = (yMax-yMin, xMax-xMin);
var (y, x) = ((i/height)*yDel+yMin, (j/width)*xDel+xMin);
var (x0, y0) = (x, y);
for(var iter = 0; iter<64; iter += 1) {
for (var iter = 0; iter<64; iter += 1) {
var (x1, y1) = ((x0*x0)-(y0*y0)+x, 2*x0*y0+y);
(x0, y0) = (x1, y1);
if ((x0*x0)+(y0*y0)>4) {