akavel, like this?: 
    
    
     Direction = random.sample( filter( [(if j+1 > 0 and j+1 < Size: 
some(Cell(x:j+1, y:i)) else: none(Cell)), (if i+1 > 0 and i+1 < Size: 
some(Cell(x:j, y:i+1)) else: none(Cell))], proc(x:Option[Cell]): bool = 
x.isSome ) )
    
    Run

Reply via email to