I could do what I wanted with the following codes, I am giving them below.
Code:
kmax = 10;
Manipulate[
Show[Graphics[{White, Polygon[{{2, 0}, {0, 0}, {0, 1}, {2, 1}}]}],
Graphics[{Cyan,
Polygon[{{2, 0}, {k^k/(k + 1)^(k + 1) (k - l),
0}, {1 + k^k/(1 + k)^(k + 1) (k - l), 1}, {2, 1}}]}]], {k, 1,
kmax, 1}, {l, 0, k - 1, 1}]
Manipulate[
Show[Graphics[{White, Polygon[{{2, 0}, {0, 0}, {0, 1}, {2, 1}}]}],
Graphics[{Magenta, Line[{{1, 1}, {2, 1}}]}]], {k, 1, kmax, 1}, {l,
0, k - 1, 1}]
Manipulate[
Show[Graphics[{White, Polygon[{{2, 0}, {0, 0}, {0, 1}, {2, 1}}]}],
Graphics[Table[If[s == k - l, Line[{{1, 1}, {2, 1}}], If[s == 0,
Line[{{1, 0}, {1, 1}}],
Line[{{1, 1},
If[(k - l)/(k - l - s) > 2, {2, (2 s - k + l)/s}, {(k - l)/(
k - l - s), 0}]}]]], {s, 0, k - l}]]], {k, 1, kmax, 1}, {l,
0, k - 1, 1}]
Manipulate[
Show[Graphics[{White, Polygon[{{2, 0}, {0, 0}, {0, 1}, {2, 1}}]}],
Graphics[{Magenta, Polygon[{{2, 0}, {1, 0}, {1, 1}, {2, 1}}]}]], {k,
1, kmax, 1}, {l, 0, k - 1, 1}] And all in one version
Code:
kmax = 10;
Manipulate[
Show[If[c == 1,
Show[Graphics[{White, Polygon[{{2, 0}, {0, 0}, {0, 1}, {2, 1}}]}],
Graphics[{Cyan,
Polygon[{{2, 0}, {k^k/(k + 1)^(k + 1) (k - l),
0}, {1 + k^k/(1 + k)^(k + 1) (k - l), 1}, {2, 1}}]}]],
If[c == 2,
Show[Graphics[{White, Polygon[{{2, 0}, {0, 0}, {0, 1}, {2, 1}}]}],
Graphics[{Cyan,
Polygon[{{2, 0}, {k^k/(k + 1)^(k + 1) (k - l),
0}, {1 + k^k/(1 + k)^(k + 1) (k - l), 1}, {2, 1}}]}],
Graphics[{Magenta, Line[{{1, 1}, {2, 1}}]}]],
If[c == 3,
Show[Graphics[{White,
Polygon[{{2, 0}, {0, 0}, {0, 1}, {2, 1}}]}],
Graphics[{Cyan,
Polygon[{{2, 0}, {k^k/(k + 1)^(k + 1) (k - l),
0}, {1 + k^k/(1 + k)^(k + 1) (k - l), 1}, {2, 1}}]}],
Graphics[
Table[If[s == k - l, Line[{{1, 1}, {2, 1}}], If[s == 0,
Line[{{1, 0}, {1, 1}}],
Line[{{1, 1},
If[(k - l)/(k - l - s) > 2, {2, (2 s - k + l)/s}, {(
k - l)/(k - l - s), 0}]}]]], {s, 0, k - l}]]],
Show[Graphics[{White,
Polygon[{{2, 0}, {0, 0}, {0, 1}, {2, 1}}]}],
Graphics[{Cyan,
Polygon[{{2, 0}, {k^k/(k + 1)^(k + 1) (k - l),
0}, {1 + k^k/(1 + k)^(k + 1) (k - l), 1}, {2, 1}}]}],
Graphics[{Magenta,
Polygon[{{2, 0}, {1, 0}, {1, 1}, {2, 1}}]}]]]]]], {k, 1, kmax,
1}, {l, 0, k - 1, 1}, {c, 1, 4, 1}] Is there a way to simplify the latter code?
Thanks.