Use 'rand' to random select a direction