예제 #1
0
    public static List <Direction> AddressesToDirections(List <int> addresses, int width, int height)
    {
        List <Direction> directions = new List <Direction>();

        for (int i = 0; i < addresses.Count - 1; i++)
        {
            int       address     = addresses[i];
            int       nextAddress = addresses[i + 1];
            Direction direction   = DirectionUtil.DirectionBetweenTwoAddresses(address, nextAddress, width, height);
            directions.Add(direction);
        }

        return(directions);
    }