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,27 @@
local canvas = require "canvas"
local function line(c, x0, y0, x1, y1, col)
local dx = math.abs(x1 - x0)
local dy = math.abs(y1 - y0)
local sx = (x0 < x1) ? 1 : -1
local sy = (y0 < y1) ? 1 : -1
local err = (dx > dy ? dx : - dy) // 2
while true do
c:set(x0, y0, col)
if x0 == x1 and y0 == y1 then break end
local e2 = err
if e2 > -dx then
err -= dy
x0 += sx
end
if e2 < dy then
err += dx
y0 += sy
end
end
end
local c = canvas.new(400, 400)
c:fill(0xffffff) -- white background
line(c, 0, 0, 399, 399, 0x0000ff) -- draw a red diagonal
io.contents("mybmp.bmp", c:tobmp()) -- save to a bitmap file