From cb5205d4af302bb6ae422ef30b2e33e412724468 Mon Sep 17 00:00:00 2001 From: ollo Date: Sun, 28 Jan 2018 14:11:14 +0100 Subject: [PATCH] Refactored character counting function --- main.lua | 2 +- wordclock.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.lua b/main.lua index 1eb98a9..9c0f3df 100644 --- a/main.lua +++ b/main.lua @@ -50,7 +50,7 @@ function displayTime() time = getTime(sec, timezoneoffset) words = display_timestat(time.hour, time.minute) - local charactersOfTime = display_countwords_de(words) + local charactersOfTime = display_countcharacters_de(words) ledBuf = generateLEDs(words, color, color1, color2, color3, color4, charactersOfTime) diff --git a/wordclock.lua b/wordclock.lua index f99d815..a7e5be2 100755 --- a/wordclock.lua +++ b/wordclock.lua @@ -136,11 +136,11 @@ function display_timestat(hours, minutes, longmode) return ret end --- @fn display_countwords +-- @fn display_countcharacters_de -- Count the amount of characters, used to describe the current time in words -- @param words the same structure, as generated with the function @see display_timestat -- @return the amount of words, used to describe the time or 0 on errors -function display_countwords_de(words) +function display_countcharacters_de(words) local amount=0 if (words.itis == 1) then amount = amount + 5