How to find if value exists in array?
Posted: Sun Jul 01, 2012 11:20 am
Hey fellas!
In PHP there is a function in_array() which says whether a particular value is present in an array or not. Is there anything of that sort in GE or C for that matter?
The particular problem is that I have a robot going through a maze. I need it to remember to which coordinates it has been already and store it in an array. I want the robot, when choosing a direction, check if the coordinate before him is in his memory, meaning that he visited it before, and not go there. How do I do that?
In PHP there is a function in_array() which says whether a particular value is present in an array or not. Is there anything of that sort in GE or C for that matter?
The particular problem is that I have a robot going through a maze. I need it to remember to which coordinates it has been already and store it in an array. I want the robot, when choosing a direction, check if the coordinate before him is in his memory, meaning that he visited it before, and not go there. How do I do that?