[
Size: a a a
[
JJ
[
K
bres :: Int -> Int -> Int -> [(Int, Int, Int)]
bres run rise1 rise2
| run < 0 = [(-x, y, z) | (x, y, z) <- bres (-run) rise1 rise2]
| rise1 < 0 = [( x, -y, z) | (x, y, z) <- bres run (-rise1) rise2]
| rise2 < 0 = [( x, y, -z) | (x, y, z) <- bres run rise1 (-rise2)]
| rise1 > max run rise2 =
[( x, y, z) | (y, x, z) <- bres rise1 run rise2]
| rise2 > max run rise1 =
[( x, y, z) | (z, x, y) <- bres rise2 run rise1]
| run < rise1 =
[( x, y, z) | (y, x, z) <- bres rise1 run rise2]
| otherwise = zip3 [0..run]
(map fst $ iterate (step rise1) (0, run `div` 2))
(map fst $ iterate (step rise2) (0, run `div` 2))
where
step rise (y, err)
| err' < 0 = (y + 1, err' + run)
| otherwise = (y, err')
where err' = err - rise
[
[
ST
[
[
[
[