From 52a4d69a2800070ba9e56d303c284f94fea7ff03 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Tue, 19 Dec 2017 13:53:35 +0100 Subject: finished Day 19 --- Puzzle19.hs | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 Puzzle19.hs (limited to 'Puzzle19.hs') diff --git a/Puzzle19.hs b/Puzzle19.hs new file mode 100644 index 0000000..522e308 --- /dev/null +++ b/Puzzle19.hs @@ -0,0 +1,59 @@ +import Data.Map (Map) +import qualified Data.Map as Map +import Data.List.Split (splitOn) +import Data.List (elemIndex) +import Data.Maybe (fromJust) + +walk :: (Int, Int) -> (Int, Int) -> [Char] -> [Char] +walk (x, y) (x', y') xs + | w == ' ' = xs + | w == '|' || w == '-' = walk (x', y') (2 * x' - x, 2 * y' - y) xs + | w `elem` alphabet = w:(walk (x', y') (2 * x' - x, 2 * y' - y) xs) + | w == '+' = walk (x'', y'') (2 * x'' - x, 2 * y'' - y) xs + where w = pmap Map.! (x, y) + x1 = y' - y + x + y1 = x' - x + y + x2 = y - y' + x + y2 = x - x' + y + (x'', y'') = if Map.findWithDefault ' ' (x1, y1) pmap == ' ' + then (x2, y2) + else (x1, y1) + +walk' :: (Int, Int) -> (Int, Int) -> Int -> Int +walk' (x, y) (x', y') n + | w == ' ' = n + | w `elem` ("|-" ++ alphabet) = walk' (x', y') (2 * x' - x, 2 * y' - y) (n + 1) + | w == '+' = walk' (x'', y'') (2 * x'' - x, 2 * y'' - y) (n + 1) + where w = pmap Map.! (x, y) + x1 = y' - y + x + y1 = x' - x + y + x2 = y - y' + x + y2 = x - x' + y + (x'', y'') = if Map.findWithDefault ' ' (x1, y1) pmap == ' ' + then (x2, y2) + else (x1, y1) + +alphabet :: [Char] +alphabet = ['A'..'Z'] + +solve1 = walk (0, y0) (1, y0) [] + where y0 = fromJust $ elemIndex '|' input + +solve2 = walk' (0, y0) (1, y0) 0 + where y0 = fromJust $ elemIndex '|' input + +pmap :: Map (Int, Int) Char +pmap = parseInput input + +parseInput :: [Char] -> Map (Int, Int) Char +parseInput xs = mat2Map $ splitOn "\n" xs + +mat2Map :: [[a]] -> Map (Int, Int) a +mat2Map xs = Map.fromList $ mconcat $ fmap f $ zipWith (,) [0 .. length xs - 1] xs + where f (x, ys) = zipWith (,) ((\y -> (x,y)) <$> [0 .. length ys]) ys + +input = input1 + +input0 = " | \n | +--+ \n A | C \n F---|----E|--+ \n | | | D \n +B-+ +--+ " + +input1 = " | \n +-------------------------------------------------------|-----------------------------+ +-------+ +-------+ +-+ +-------------------------------------------------------------+ \n | | | | | | | | | | | \n | +-------+ +---------------+ | +-------|---------|-+ | +-|-----------------------------------------+ | \n | | | | | | | | | | | | | | | | | \n | | +---------------------|-----------------------------------------|-------|-----+ | | | +-|---+ +-----------------------------------------+ \n | | | | | | | | | | | | | | | | | \n | | +---------------------------|---+ +-------+ +---|---+ +-|-------|-------------------------------+ | | | +-+ | | \n | | | | | | | | | | | | | | | | | | | | | | | | | \n +---------|---------------------------------|---------|---------|---------------|---------------|---|-------------------|-|-------------------------------|-------+ | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | +-----|-------------------------------------------------|---|---------------------------|-------|-------------------------------------------------------------------------------+ | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | +---------|-----|---+ | | | | +-----+ | +---|-+ +-----------------------------|---------|---------------|-----|-----+ | \n | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | +-+ +-----------|-----------+ | | | | +-------------+ | | | +-------------------+ | | +-----|---|---+ \n | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | +-------|---|-----------|-----------|-------------------|---|-------------|-------------------------------|-----------|---------|---------------+ | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | +-----|-----------------|-----------------|-+ | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | +-+ | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | +-+ | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | +-----------------|-----------|-----+ | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n +-+ +-------------------------------+ | +---------|-----------------|-------|---------------------------|---------------|-------+ | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n +-|-|---+ | | +---------------+ | +-------------|-------------|---------+ | | +---------|---------|---|---------------+ | | | | | | +-----|-------------+ \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n +-+ | | +---------------------+ | | | +-------------------------|-----------------+ | | | | | | | | | | | | | | | | +---+ | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | +-|-|-----------------|-----------------|---|-|-------|---|---------------------|---------------|---|-------|---------------------------------|-------------------+ | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | +---------------------------------|-------+ | | | | | | | | | | | | | | | | +-----------+ | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | +---|-----------|-|-----+ | | +-------|-------------------+ | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n +-|-----+ | | | +-|-------|-----|-------------|-------------|---------------------------|-------|-----------|---|---------------|-|-----------------+ | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n +-------+ +-|-|---+ | | | | | | | | | | | | | | +---|---------------|---------------|---------------+ | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | +-|-|-+ | | | | | | +-------|-|---|-------+ | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | +---|---|-|-+ +-------|-----|-----------|---|-------------|-------------|---------------|-----------|-------|-|-------------|-----------+ | | +-------------------|-----|-+ | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | +-+ | | +-|-----|-----------|---------|-|---|-------+ | | +---------+ | | | | | | | | | +-----------|-----|-----------------|-----------|-+ | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | +-----|-------------|---------|-----|---------------------------|-----------------------|-------|-----------------------------+ | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | +---------|---|-------+ | | | | | | | | | | | | | | | | +---+ | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n +---+ | | | +---|-|-----|-----|-------------------------|---|-------------|-------|-------|-------|---|-------|-|---------|-------------|-|---|---|---+ | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | +---------------|---|-------------------|-----------+ | | | | | | | | | | | | | | | | | +---+ | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | +---------|-----|---------|-----------------|-|---------+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | +-|-|-----------|---------|---------------+ +-|---+ +-------+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | +-------------|-------|---|---------|---------|-------------|-|---|-|-|-----------|---|-------+ | | +-------|---|---|-|---+ \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | +-----------------------------------|---|-|---------------+ | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | +-|-|-----------|-------+ | | | | | +-|-----|-----------------|---|-------|-----|---------|-------------|-|---|---|---|-----------|-|-|-----|-------------+ | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | +-------+ | | | | | | | | | | | | | | | | +---|-----|-|---+ | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | +---+ +---|---|---|---------|---+ | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | +-|-----------------|-----------------|-|-----+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | +-|-------+ +---|-----------------|---|-+ | | | | | | | +-----|-------|-------------|---------|-------------|-|-----|-|-----|---+ | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | +-|---|-------------------+ | | +-------+ | | | | | | | | | +---|---------------------|---------|-------------|-|---|---|---+ | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | +-+ | | +-|---|-------------|---|-----|-|-|-|---|-|---|-|-|---|-------+ | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | +---------|-------|-|-------------|-----+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | +-|-------|-|-----------------------|---+ | | +---------------|---------|-|-|-----------|-----|-----|-|-|-----|---+ \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n +-|---------|-|-------------------|-----|-------------|---|-----|-|---|-----|-|-----|-------------------|---|-|---------|-------------------|-|-+ | +---------|-------|-+ | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | +-----|---|-|-----+ | | | | | | | | | | | | | | | +-----|-+ | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | +---|-|-|---------------------------------------------------|-----------+ | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-+ | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | +---------|---|-|-|-+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | +---|---|-------------|-|---------------------|-------|-|-|---|---|---|---------------------|---|-----------|-------|-----|-|-----|-+ | +-|-+ | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | +-------+ +-----|-|-----------------------+ | | | | | | | | | | | | | +---------|-------------|-----|-|-----------|---|-+ | | | | | | | | | +-----+ | \n | | | | | | | | | | | A | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | +-|-----------------|-----|-------|-|-------|---|-|---|-------------------|-----------|-------|-----|-----------|-------|-----|-|-|-----|-----------|---------|-+ | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | +-|---------|---|-------|-------------------|---------|-|---|-|-----|---+ | | | | | | | | | +-------|-+ | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | +-|---------------------------|-------|-|-----+ +-----+ | | | | | +-------|-----|-|-|-+ | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | +-|-+ +---------|-|-------------------|-|---|---|-|---|---------|---------------------|-------------|-------|-----|-------|-|---------+ | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-------|---|-----+ | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | X | | \n | | | | | | | | | | | | | | | | | | | | | | | | | +---------------|-|-------------------|-----------|---+ | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | +---|-|-----|---|-----------|-|-------------------------------------------|-------------|-------------|-----|-|-+ | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n +-|---------|-----------------+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +---------|-------|-----|-|-+ | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-|-------|---|-----|---|-----------|-----+ | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | +-----------|---|-|-----|-|-----|---------------------------|-|-|-|---|-|-|---|-------|-----------------|-|---------|-----|-------+ | | | | | | +-------|-----+ | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n +-------|-|---------------------|---------------------------------|-----|---|-|-----|-----|-+ | | | | | | | +---|-+ +---+ | | +-|---|-----|---|---|-+ | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | +-+ +---|-|---+ | | | +-|---+ | | | | | | | | | | | | | +-|---|---|---------|---|-----+ | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n +-|-----|-|-----|---|-|-------------|-|-------------+ | | | | | | | | | | | | +-----------|-|-------------|-----------------|---------|-|-------|---|-----|-+ | | +-+ | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | +-|-------+ | | | | | | | | | | | | +-----|-|-------|-----------|-|-------------------|-|-------|-----------+ | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n +-+ | +---------|-----|---|-----------|---|-----------|---|-|-----------|-|-------|---------|-----+ | | | | | | | | | | | | +---|-|---|---------+ | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n +---|-----|-----+ | | | | | | | | | | | | | | | | | +-------|-------------+ | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n +---|-----------------|-----|-|-----------|-----------|-|---|-------|---|-|---------|-|-----------|-------------|---------------|-|-----|-|-------------|-----------+ | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | +-------|-+ | | | +---|---------+ | | | | | | | | | | +-|-----------------------|-----------|---|---+ | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n +-|-|-------|-----|---|-----|---|-------|-|-----------|-------------|---|-----------------|---------------|-|-|-----+ | | | | +-----------|-+ | | +-|---------+ | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | +-|-----|-----+ | | | | | | | | | | | | | +-|-------------|------------Z|---|-----------------------+ | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | +-+ | +-----------------------------|-----|-----|---------------|---|---------------|-----+ | | +-------------------|-----------------|-|---|-|-------|-|-+ | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n +-|-+ | | | | | | | | +---------------------+ | | | | | | | | +---|-------|-|-------------|-------------|-------------|-----|-------------|-----|-----+ | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | +---|-+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | +---|---------|-|-------------|---------|-|-|-------------------------------------|-----|---+ | | | | +-----|-------+ | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-------|-----+ +-------+ | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | +-----+ | | | | | +---|-----|-------|---------------------------|-+ | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | +---------|-----|-----|-----|-+ | | | | +---------------------------|-------|-------|-|-|-----+ | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | +-------------|--I--------+ | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | +-----------------+ | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | +---|-------------------------|---------------------------|-----|---+ | | | | | | | | | | | | | +-+ | +-+ | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | +-|---------|-|---------------------------|-----|---+ | | | | | | | | | | +-----------|-|-----+ | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n +-|-------------|---------|---------|---|-|-|---------|-|---------------------------------|-------|-------|-|-------------------------------------+ +-|-----|---------------|-|---+ | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | +---+ | +---------------------------------|---------------|-----------------------------------+ +-|-----------------------------+ | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | +-+ +-------------------|-----|---------------+ | | | +---|-------|-|---|---|-----------|-------------|-----|-+ | +-+ | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | +-----+ +---------|-----------------|---|-----------------------+ | | | +-----------|-|---|-------------------------------|-------|-----------|-------------+ | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n +-------|---|---------------------------|---------------------------------------------------|---------------|-|---|-----------|-------------+ | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n +-------------------|-----|-----|---------------|-----------------------------------|-------------|-------------------|-------------------|-------|---------------|-|---------|-----|-+ | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | +-----------------|-----------+ | | | | | | | | | | | +-------|---|-----------------+ | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | | | \n | +-----------|U----|---------------+ | | | | | | | | | | | | +-----|---|-------|---|-------+ \n | | | | | | | | | | | | | | | | | | | | | | | \n +-|---------------------|-----------------------------------------------|-+ | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | | | | | | +-----+ | | | | | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | +-----------------------------|-----|---|--------S--|-|---|---------------|---------------------------|---------------+ | +-+ +-|-------+ \n | | | | | | | | | | | | | | | | | | | | | | | \n | | | | | | | | | | | +-------------+ +---------------------------+ +---+ | | \n | | | | | | | | | | | | | | | | | | | \n | | | | | +-|-----------------------------|-----|---|-----------|-----|-------------------------------------------+ +---------|-|-----------------------+ \n | | | | | | | | | | | | | | | | | | B | | | | \n +---------|-|---------------------|-----------------------------------------------|-+ | +-----------------------|---------------------------------------------|-----------------+ | | | \n | | | | | | | | | | | | | | | | | | | | | | | | | \n Y +---------|-----------------------+ +-----------------------------------------+ +-|-------------|-----|---|---------------------------------------|-----|-----+ +-+ +-+ | | | | \n | | | | | | | | | | | | | | | | | | | | | | \n | | | | +-----------------+ +-------------------------------------+ | | +-+ +-------------------------------------|-|-------------|-----|-------+ | | | \n | | | | | | | | | | | | | | | | | | \n | +---+ | | | +--------------------------------------------W----------------|-----|-----+ +-----+ +-----+ +-------+ \n | | | | | | | | | | \n +-------+ +---------------+ +-----------------------------------------------------------------------+ +-+ +---------------------+ \n " -- cgit v1.2.3