hi there I have code where I have intervals.When I run the code I sometimes get this error.
" attempt to compare number with nil
stack traceback"
code is …
display.setStatusBar( display.HiddenStatusBar ) a = math.random( 60,1120) if a \> 1020 then b = math.random( 60, 800) print("B") elseif a \> 700 then b = math.random(60,480) print("BB") elseif a \> 380 then b = math.random( 60, 160) print("BBB") elseif a \< 160 then b = math.random(380, 1120) print("BBBB") end if ( a and b \> 160) and ((a \> 160) and( b \> 160)) then c = math.random( 60, 160) print("C") elseif ( a and b \< 1020) and (( a \< 1020) and ( b \< 1020) )then c = math.random(1020,1120) print("CC") elseif ( a and b \> 700 or a and b \< 800) and (( a \> 700 or a \< 800) and ( b \> 700 or b \< 800)) then c = math.random(700, 800) print("CCC") elseif( a and b \> 380 or a and b \< 480) and (( a \> 380 or a \< 480) and ( b \> 380 or b \< 480)) then c = math.random( 380, 480) print("CCCC") end print(a) print(b) print(c)
I think the composer is not getting any appropriate values to perform operations for code to print “CCC” and “CCCC”