aboutsummaryrefslogtreecommitdiff
path: root/src/polka.sql
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2026-06-07 17:46:08 +0530
committerAkshay Nair <phenax5@gmail.com>2026-06-07 17:46:08 +0530
commitafaf82538d09cd77ee4f5a435b79995e88be84f5 (patch)
tree5fb4db643debbd3a04b010e1470838750b427dd6 /src/polka.sql
parentb893b29d7be4fadb563187d2c6ed20865686aeff (diff)
downloadsqlite-creative-coding-afaf82538d09cd77ee4f5a435b79995e88be84f5.tar.gz
sqlite-creative-coding-afaf82538d09cd77ee4f5a435b79995e88be84f5.zip
Rename the files
Diffstat (limited to 'src/polka.sql')
-rw-r--r--src/polka.sql24
1 files changed, 0 insertions, 24 deletions
diff --git a/src/polka.sql b/src/polka.sql
deleted file mode 100644
index 3d72540..0000000
--- a/src/polka.sql
+++ /dev/null
@@ -1,24 +0,0 @@
-INSERT OR REPLACE INTO images (id, width, height) VALUES ('polka', 400, 400) RETURNING id;
-
-WITH RECURSIVE
- image AS (SELECT *, width/10 AS gapx, height/10 AS gapy, 16.0 AS size FROM images WHERE id = 'polka'),
- horizontal(x) AS
- (SELECT width FROM image UNION ALL SELECT x - 1 FROM horizontal WHERE x > 1),
- vertical(y) AS
- (SELECT height FROM image UNION ALL SELECT y - 1 FROM vertical WHERE y > 1),
- dotsx(dotx, column) AS (
- SELECT 0, 0 UNION ALL
- SELECT dotx + gapx, column + 1 FROM dotsx, image WHERE dotx < width
- ),
- dotsy(doty, row) AS (
- SELECT 0, 0 UNION ALL
- SELECT doty + gapy, row + 1 FROM dotsy, image WHERE doty < height
- ),
- _pixels(x, y, r, g, b) AS (
- SELECT x, y,
- IFNULL((SELECT 60 * abs((row % 5) - (column % 5)) FROM dotsx, dotsy
- WHERE POW(x - dotx - gapx*(row%2)/2.0, 2) + POW(y - doty, 2) < size*size LIMIT 1), 0),
- 50, 70
- FROM vertical, horizontal, image
- )
-INSERT INTO pixels (image_id, x, y, r, g, b) SELECT 'polka', x, y, r, g, b FROM _pixels;