Jump to content

2048: Difference between revisions

m
→‎{{header|Lua}}: small logic change
(→‎{{header|Lua}}: added Lua)
m (→‎{{header|Lua}}: small logic change)
Line 8,460:
local loopdata = {{0,12,4,1,4,1},{0,12,4,4,1,-1},{1,4,1,0,12,4},{1,4,1,12,0,-4}}
local ofr,oto,ost,ifr,ito,ist = unpack(loopdata[dir])
self.diff = false
self:pack(ofr,oto,ost,ifr,ito,ist)
self:comb(ofr,oto,ost,ifr,ito,ist)
Line 8,487 ⟶ 8,486:
io.write("Your move (wasd + enter, or q + enter to quit): ")
local char = io.read()
self.diff = false
if (char=="a") then self:move(1)
elseif (char=="d") then self:move(2)
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.