refactor: rename LOWER_LIMIT and HIGHER_LIMIT

This commit is contained in:
Guillaume ARM 2024-05-09 02:25:20 +02:00
parent 51eff0fa63
commit 772d94693d

View File

@ -8,6 +8,10 @@ local config = {
size = 16 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 INITIAL_TARGET_Y = config.targetY - config.startY
local TARGET_Z = config.size - 1 local TARGET_Z = config.size - 1
local TARGET_X = 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_Y = INITIAL_TARGET_Y + (config.height - 1)
local MAX_Z = TARGET_Z local MAX_Z = TARGET_Z
local LOWER_LIMIT = 2;
local HIGHER_LIMIT = 128;
local robot = robotApi.create() local robot = robotApi.create()
local MAX_INVENTORY_BLOCKS = 16 * 64 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 MIN_FUEL_NEEDED = 2 * ((config.size * 2) + INITIAL_TARGET_Y) + MAX_INVENTORY_BLOCKS + ADDITIONAL_FUEL_NEEDED
local miner = { local miner = {
@ -46,12 +47,12 @@ local function checkConfig()
error('height cannot be lower than 1') error('height cannot be lower than 1')
end end
if config.size < LOWER_LIMIT then if config.size < LOWER_SIZE_LIMIT then
error('size cannot be lower than ' .. LOWER_LIMIT) error('size cannot be lower than ' .. LOWER_SIZE_LIMIT)
end end
if config.size > HIGHER_LIMIT then if config.size > HIGHER_SIZE_LIMIT then
error('size is too large (higher limit is ' .. HIGHER_LIMIT .. ')') error('size is too large (higher limit is ' .. HIGHER_SIZE_LIMIT .. ')')
end end
if isOdd(config.size) then if isOdd(config.size) then