Java Reference
In-Depth Information
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1
1 8 28 56 70 56 28 8 1
PP 12.10 Design and implement an applet that generalizes the
KochSnowflake program. Allow the user to choose a fractal
design from a menu item and to pick the background and draw-
ing colors. The buttons to increase and decrease the order of
the fractal will apply to whichever fractal design is chosen. In
addition to the Koch snowflake, include a C-curve fractal whose
order 1 is a straight line. Each successive order is created by
replacing all line segments by two line segments, both half of the
size of the original, and which meet at a right angle. Specifically,
a C-curve of order N from
6
x 1 , y 1 7
to
6
x 3 , y 3 7
is replaced by
two C-curves from to and from
6
x 2 , y 2 7
to
6
x 3 , y 3 7
where:
x2
=
(x1
+
x3
+
y1
-
y3)
2;
2;
PP 12.11 Design and implement a graphic version of the Towers of
Hanoi puzzle. Allow the user to set the number of disks used in
the puzzle. The user should be able to interact with the puzzle
in two main ways. The user can move the disks from one peg
to another using the mouse, in which case the program should
ensure that each move is legal. The user can also watch a solu-
tion take place as an animation, with pause/resume buttons.
Permit the user to control the speed of the animation.
PP 12.12 Write a program that implements a recursive search of a sorted
list of strings. Your program should include a recursive method
y2
=
(x3
+
y1
+
y3
-
x1)
Search WWH ::




Custom Search