From 6dc4f40a3fc2e1fc286490d55f93a4e9293ae119 Mon Sep 17 00:00:00 2001 From: Abigail Date: Sat, 8 May 2021 19:42:08 +0200 Subject: Make variable local in Lua --- challenge-111/abigail/lua/ch-1.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'challenge-111/abigail/lua') diff --git a/challenge-111/abigail/lua/ch-1.lua b/challenge-111/abigail/lua/ch-1.lua index 194e55b458..eb324dfa85 100644 --- a/challenge-111/abigail/lua/ch-1.lua +++ b/challenge-111/abigail/lua/ch-1.lua @@ -10,7 +10,7 @@ local MATRIX_SIZE = 5 -matrix = {} +local matrix = {} -- -- Read in the matrix @@ -24,7 +24,7 @@ end -- whether the number is present in the matrix or not. -- while true do - target = io . read ("*number") + local target = io . read ("*number") if target == nil then break end if matrix [target] then print (1) -- cgit