AdamMathieson

Untitled

Mar 29th, 2024 (edited)
717
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. function renderHeart(angle)
  2.     local scale = 10
  3.  
  4.     for y = 2 * scale, -scale, -1 do
  5.         local line = ""
  6.         for x = -6 * scale, 7 * scale do
  7.             if ((x / scale) ^ 2 + (y / scale) ^ 2 - 1) ^ 3 - (x / scale) ^ 2 * (y / scale) ^ 3 <= 0 then
  8.                 line = line .. "*"
  9.             else
  10.                 line = line .. " "
  11.             end
  12.         end
  13.         print(line)
  14.     end
  15. end
  16.  
  17. function main()
  18.     local angle = 0
  19.     while true do
  20.         renderHeart(angle)
  21.         angle = angle + 2
  22.         os.sleep(0.1)
  23.     end
  24. end
  25.  
  26. main()
  27.  
Advertisement
Add Comment
Please, Sign In to add comment