Samurai Goroh: That first one's not an invalid test - if any of the entries are a 2 (except for entry 7), then it can't succeed, and at least one entry that isn't entry 2 has to be a 7 for it to succeed.
jlun2: That second one is actually one if easier than the first one since you're not jumping around in the array - it can be done with just one function.
--this code doesn't actually work, by the way, or at the very least doesn't work as intended.
function test_is_present(array array, int target) as Boolean
for each i in array,
if (readbyte(array[i]) == target) then
return true
else
return false
end if
end for
end function
if ((test_is_present(lift, 1) == true) and (test_is_present(lift, 6) == true)) then
magic()
end if
and you just flip a true to a false in the if around magic if you need the tested value to not be there.