An AI generated Merry Christmas!






Connor McDonald eagerly awaits Santa Claus, beautifully decorating the Christmas tree. I got a little jealous and enlisted My Personal ChatGPT to help. Let’s see which one is better! But I don’t have high expectations, because for some unknown reason my ChatGPT has been calling me Wojtek for months. So I didn’t expect much from it.

Nevertheless, the challenge was accepted!
After many attempts, we managed to generate a beautiful Christmas tree with a present. But there were no colorful ornaments. So I asked ChatGPT to randomly color the ornaments (the stars) on the tree. On the first try, it colored the middle stars. Quite nicely, even. But when I asked for RANDOM stars to be colored, it completely lost track. Either it kept coloring stars in a line, or it messed up half the tree or the present entirely. In the end, I gave up—and I “randomized” the colors myself.
I also organized the query generated by ChatGPT, separating the colors into a CTE.

Nevertheless, I wish everyone beautiful Christmas trees and wonderful presents!



WITH col AS (
    SELECT 
        CHR(27) || '[31m*' || CHR(27) || '[0m' AS r,
        CHR(27) || '[33m*' || CHR(27) || '[0m' AS y,
        CHR(27) || '[32m*' || CHR(27) || '[0m' AS g
    FROM dual
)
SELECT tree_line
FROM (
    SELECT '           ' || c.r AS tree_line, 1 AS ord FROM col c UNION ALL
    SELECT '          ' || '*' || c.y || '*'  AS tree_line, 2 FROM col c UNION ALL
    SELECT '         ' || '*' || '*' || c.g || '*' || c.y AS tree_line, 3 FROM col c UNION ALL
    SELECT '        ' || '*' || '*' || '*' || c.r || '*' || '*' || '*' AS tree_line, 4 FROM col c UNION ALL
    SELECT '       ' || c.g || '*' || c.y || '*' || c.r || '*' || '*' || c.r || '*' AS tree_line, 5 FROM col c UNION ALL
    SELECT '      ' || '*' || '*' ||c.g || '*' || '*' || c.y || '*' || '*' || c.r || '*' || c.y AS tree_line, 6 FROM col c UNION ALL
    SELECT '     ' || c.r || '*' || '*' || c.y || '*' || '*' || c.g || '*' || '*' || '*' || '*' || c.y || '*' AS tree_line, 7 FROM col c UNION ALL
    SELECT '    ' || '*' || '*' || c.y || '*' || '*' ||c.g || '*' || c.r || '*' || c.r|| '*' || '*' || c.r || '*' || '*' AS tree_line, 8 FROM col c UNION ALL
    SELECT '   ' || '*' || c.y || '*' || c.g || '*' ||c.r|| '*' || '*' || c.y || '*' || '*' || c.g|| '*' || '*' || '*' || '*' || '*' AS tree_line, 9 FROM col c UNION ALL
    SELECT '  '||c.g || '*' || '*' || c.r || '*' || c.y || '*' || c.r || '*' || '*' || c.g || '*' || c.y|| '*' || '*' || c.r || '*' || '*' || c.y AS tree_line, 10 FROM col c UNION ALL
    SELECT '            |  '|| CHR(27) || '[31m+-----+'|| CHR(27) || '[0m', 11 FROM dual UNION ALL
    SELECT '            |  '|| CHR(27) || '[31m|     |'|| CHR(27) || '[0m', 12 FROM dual UNION ALL
    SELECT '            |  '|| CHR(27) || '[31m+-----+'|| CHR(27) || '[0m', 13 FROM dual
)
ORDER BY ord;

Komentarze