We have investigated a problem where the goal is to find automatically the best rule for a cell in the cellular automata model. The cells are either of type OBSTACLE, EMPTY or CREATURE. Only CREATURE can move around in the cell space in one changeable direction and can perform four actions: if the path to the next cell is blocked turn left or right, if the path is free, i. e. the neighbor cell is of type EMPTY: move ahead and simultaneously turn left or right. The task of the creature is to cross all empty cells with a minimum number of steps. The behavior was modeled using a variable state machine represented by a state table. Input to the state table is the neighbors state in front of its moving direction. All combinations of the state table which do not expect a trivial or bad behavior were considered in software and in hardware in order to find out the best behavior. The best four-state algorithm allows the creature to cross 97 % empty cells on average over the given initial con...