The variable "direction" is a built-ion local variable represented by a number. 0 is pointing right, 90 is up, and so on. You are trying to compare that number to a string. It doesn't work that way. You must either change the checks to look for numbers, or declare the variable as a string in the first place.