main.lua:33: '<eof>' expected near 'end'

local title = display.newText(“Tic-Tac-Toe”, display.contentCenterX, 25, native.systemFontBold, 20)

local leftVerticalLine = display.newRect (display.contentCenterX - 50, display.contentCenterY, 5, 300)

local rightVerticalLine = display.newRect (display.contentCenterX + 50, display.contentCenterY, 5, 300)

local topHorizontalLine = display.newRect (display.contentCenterX, display.contentCenterY - 50, 300, 5)

local bottomHorizontalLine = display.newRect (display.contentCenterX, display.contentCenterY + 50, 300, 5)

local spots = {}

local player = “X” --Player X always goes First

local funtion handleMove( event )

    if event.phase == “began” then

        if event.target.moveType == nil then

            if player == “X” then

                event.target.moveText.text = player

                event.target.moveType = player

                player = “O”

            else

                event.target.moveText.text = player

                event.target.moveType = player

                player = “X”

            end

        end

    end

    return true

end

for i = 1, 9 do

    spots[i] = display.newRect(0, 0, 90,90)

    spots[i]:setFillColor(0.2, 0.2, 0.2)

    spots[i].x = (i - 1) % 3 * 100 + 60

    spots[i].y = math.floor( (i - 1) / 3) * 100 + 140

    spots[i].moveText = display.newText(i, spots[i].x, spots[i].y, native.systemFontBold, 80)

    spots[i].moveType = nil

    spots[i]:addEventListener(“touch”, handleMove)

end

I have been trying to fix this for about an hour and i dont know why this happens the error is somewhere in the function but i dont know where

It is likely that it’s line 1. It’s broken across multiple lines. You can’t split individual Lua statements across multiple lines.

Rob

It means you have too many "end"s around that line.

Edit: That’s usually why I get the error but your reason is most likely what roaminggamer said down below. vvv

You’ve misspelled function.

lol, I just hate these kind of mistakes :smiley: so simple but can take hours to figre out :smiley: