From 07e8f88c418850a74606b4043bf52d2e770020b8 Mon Sep 17 00:00:00 2001 From: mint Date: Thu, 6 May 2021 13:46:25 -0400 Subject: [PATCH] Revert "what would happen if we didn't round?" This reverts commit cea2212babac8705e7eaa0b9209c8d34eb3289aa. --- rhythmblock.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rhythmblock.lua b/rhythmblock.lua index 4ffcf88..1181d28 100644 --- a/rhythmblock.lua +++ b/rhythmblock.lua @@ -2,9 +2,13 @@ accentColor = colors.gray buttonColor = colors.lightGray backgroundColor = colors.black +function round(n) + return n % 1 >= 0.5 and math.ceil(n) or math.floor(n) +end + width, height = term.getSize() -centerWidth = width / 2 -centerHeight = width / 2 +centerWidth = round(width / 2) +centerHeight = round(width / 2) peripherals = peripheral.getNames() playing = false if #peripherals < 0 then