• Pieter as I understand it your rules say...

    IF North is empty and South is empty and East is empty and West is empty and there's a can on the current position THEN pick up can

    ELSE

    IF North is empty and South is empty and East is empty and West has a can and there's a can on the current position THEN pick up can

    ELSE

    IF North is empty and South is empty and East is empty and West has a wall and there's a can on the current position THEN move South

    To work out how it applies to the grid - pick a square, see want adjacent and on the current square and find the rule that matches (though when there are more than one matching rules it would depend on bit of dna created that rule)