Data update

This commit is contained in:
Ingy döt Net 2025-08-11 18:05:26 -07:00
parent 4d5544505c
commit 4924dd0264
3073 changed files with 55820 additions and 4408 deletions

View file

@ -0,0 +1,33 @@
local canvas = require "canvas"
local function trunc(x) return x >= 0 ? math.floor(x) : math.ceil(x) end
local function circle(c, cx, cy, r, col)
local d = trunc((5 - r * 4) / 4)
local x = 0
local y = r
repeat
c:set(cx + x, cy + y, col)
c:set(cx + x, cy - y, col)
c:set(cx - x, cy + y, col)
c:set(cx - x, cy - y, col)
c:set(cx + y, cy + x, col)
c:set(cx + y, cy - x, col)
c:set(cx - y, cy + x, col)
c:set(cx - y, cy - x, col)
if d < 0 then
d += 2 * x + 1
else
d += 2 * (x - y) + 1
y -= 1
end
++x
until x > y
end
local c = canvas.new(400, 400)
c:fill(0xffffff) -- white background
-- Draw a blue circle with centre at (200, 200) and radius 100.
circle(c, 200, 200, 100, 0xff0000)
io.contents("mybmp.bmp", c:tobmp()) -- save to a bitmap file