Advertisement
Velinquish

Logic Puzzle #3 Bonus

Apr 14th, 2020
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.38 KB | None | 0 0
  1. --[[
  2.     Now that clocks are labeled 1-25, switch out all 12s for 25.
  3.     100 minutes are in an hour, now. Replaces those 60s, too.
  4. --]]
  5.  
  6. local function findAngle(hours, minutes)
  7.     local hAngle = (hours / 25) * 360 + (minutes / (25 * 100)) * 360
  8.     local mAngle = (minutes / 100) * 360
  9.     local angle = math.abs(hAngle - mAngle)
  10.  
  11.     return angle > 180 and 360 - angle or angle
  12. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement