I need help comparing tables

hello I need help comparing tables 

array = {}

play ={}

a = 0

function check()

    a= a+1

    for x =0,a do 

       if  array[x] <= play[x] then

       print (“yes”)

    else 

       print(“no”)

    end

 return print(array[x])

end

end

  1. To get the best help, please always format your code in a code block.

formatyourcode.jpg

  1. You didn’t give me much to go on in your question, but here is one of many ways to compare values in tables…

    local array = { 1, 2, 2, 3, 2, 2 } local play = { 1, 3, 2, 3, 4, 2 } local matchCount = 0 for i = 1, #array do if( array[i] == play[i] ) then print( i, “Matches” ) else print( i, “No Match”, array[i], play[i] ) end end

sorry for not formatting my code but thanks for helping me you answered my question .

  1. To get the best help, please always format your code in a code block.

formatyourcode.jpg

  1. You didn’t give me much to go on in your question, but here is one of many ways to compare values in tables…

    local array = { 1, 2, 2, 3, 2, 2 } local play = { 1, 3, 2, 3, 4, 2 } local matchCount = 0 for i = 1, #array do if( array[i] == play[i] ) then print( i, “Matches” ) else print( i, “No Match”, array[i], play[i] ) end end

sorry for not formatting my code but thanks for helping me you answered my question .