Advertisement
NUCLEARESOL

Cheater

Apr 5th, 2024
691
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.80 KB | None | 0 0
  1. local col={0,0,0,0}
  2. local row= {0,0,0,0}
  3. local row1= {0,0,0,0}
  4. local row2= {0,0,0,0}
  5. local row3= {0,0,0,0}
  6. local row4= {0,0,0,0}
  7.  
  8. local function checkrow(txt,n,tabled)
  9.     for count =1,9,1 do
  10.         nq, n = string.gsub(txt,tostring(count),"#")
  11.         if n>=2 then return false end
  12.     end
  13.     local sum=0
  14.     for _, v in pairs(tabled) do
  15.         if tonumber(v) then
  16.             sum = sum+v
  17.         end
  18.     end
  19.     if sum == n then return true end
  20.     return false
  21. end
  22. while true do
  23.    
  24.    if checkrow(table.concat(row1),row[1],row1)== false then goto continue end
  25.    if checkrow(table.concat(row2),row[2],row2)== false then goto continue end
  26.    if checkrow(table.concat(row3),row[3],row3)== false then goto continue end
  27.    if checkrow(table.concat(row4),row[4],row4)== false then goto continue end
  28.    
  29.    ::continue::
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement