math.randomseed( os.time() )
local puz = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0 }
local dir = { { 1, 0 }, { -1, 0 }, { 0, 1 }, { 0, -1 } }
local sx, sy = 4, 4 

function isValid( tx, ty )
    return tx > 0 and tx < 5 and ty > 0 and ty < 5  
end
function display()
    io.write( "\n\n" )
    for j = 1, 4 do
        io.write( "+