Here is my code:
[lua]
local bgimage=display.newImageRect(“images/black.png”, 360, 570)
bgimage.x = display.contentCenterX
bgimage.y = display.contentCenterY
local pattern={
{0,1,1,1,1,1,1},
{0,1,0,0,1,0,0},
{0,1,0,0,1,0,0},
{0,1,0,0,1,0,0},
{0,1,0,0,0,0,0},
{0,1,0,0,0,0,0},
{0,1,0,0,0,0,0},
{0,1,0,0,0,0,0},
{0,1,0,0,0,0,0}}
function pattern1()
for row = 1, 8 do
for col = 1, 9 do
local image = display.newImageRect(“images/white.png”, 22,21)
image.x=math.floor(-10 + (31.3 * row))
image.y=math.floor(-10 + (35 * col))
local tf = display.newText(’’, 0, 0, ‘Arial’, 19)
tf:setTextColor(0, 0, 0)
tf.width = 22
tf.height = 21
tf.x = math.floor(-10 + (31.3 * row))
tf.y = math.floor(-10 + (35 * col))
– Change 0’s to Random Letters
if(pattern[col][row] == 0) then
image:removeSelf()
image=nil
else
tf.text=“0”
end
end
end
end
pattern1()
local bgimage=display.newImageRect(“images/black.png”, 360, 570)
bgimage.x = display.contentCenterX
bgimage.y = display.contentCenterY
local pattern={
{0,1,1,1,1,1,1},
{0,1,0,0,1,0,0},
{0,1,0,0,1,0,0},
{0,1,0,0,1,0,0},
{0,1,0,0,0,0,0},
{0,1,0,0,0,0,0},
{0,1,0,0,0,0,0},
{0,1,0,0,0,0,0},
{0,1,0,0,0,0,0}}
function pattern1()
for row = 1, 8 do
for col = 1, 9 do
local image = display.newImageRect(“images/white.png”, 22,21)
image.x=math.floor(-10 + (31.3 * row))
image.y=math.floor(-10 + (35 * col))
local tf = display.newText(’’, 0, 0, ‘Arial’, 19)
tf:setTextColor(0, 0, 0)
tf.width = 22
tf.height = 21
tf.x = math.floor(-10 + (31.3 * row))
tf.y = math.floor(-10 + (35 * col))
– Change 0’s to Random Letters
if(pattern[col][row] == 0) then
image:removeSelf()
image=nil
else
tf.text=“0”
end
end
end
end
pattern1()
[/lua]