From 772d94693d79088f81b979c48c30ef220a165ac1 Mon Sep 17 00:00:00 2001 From: Guillaume ARM Date: Thu, 9 May 2024 02:25:20 +0200 Subject: [PATCH] refactor: rename LOWER_LIMIT and HIGHER_LIMIT --- miner.lua | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/miner.lua b/miner.lua index 3fe76b0..7dfa477 100644 --- a/miner.lua +++ b/miner.lua @@ -8,6 +8,10 @@ local config = { size = 16 } +local LOWER_SIZE_LIMIT = 2; +local HIGHER_SIZE_LIMIT = 128; +local ADDITIONAL_FUEL_NEEDED = 256 + local INITIAL_TARGET_Y = config.targetY - config.startY local TARGET_Z = config.size - 1 local TARGET_X = config.size - 1 @@ -16,13 +20,10 @@ local MAX_X = TARGET_X local MAX_Y = INITIAL_TARGET_Y + (config.height - 1) local MAX_Z = TARGET_Z -local LOWER_LIMIT = 2; -local HIGHER_LIMIT = 128; local robot = robotApi.create() local MAX_INVENTORY_BLOCKS = 16 * 64 -local ADDITIONAL_FUEL_NEEDED = 256 local MIN_FUEL_NEEDED = 2 * ((config.size * 2) + INITIAL_TARGET_Y) + MAX_INVENTORY_BLOCKS + ADDITIONAL_FUEL_NEEDED local miner = { @@ -46,12 +47,12 @@ local function checkConfig() error('height cannot be lower than 1') end - if config.size < LOWER_LIMIT then - error('size cannot be lower than ' .. LOWER_LIMIT) + if config.size < LOWER_SIZE_LIMIT then + error('size cannot be lower than ' .. LOWER_SIZE_LIMIT) end - if config.size > HIGHER_LIMIT then - error('size is too large (higher limit is ' .. HIGHER_LIMIT .. ')') + if config.size > HIGHER_SIZE_LIMIT then + error('size is too large (higher limit is ' .. HIGHER_SIZE_LIMIT .. ')') end if isOdd(config.size) then