r     revividus.com



Bible

Bible

Java

Java

Comp-Sci

Comp-Sci

Music

Music

Links

Links

Manera

Manera


Java - page 2


back to java main
StopLight


Loopy.java
This is a chess board applet. It accepts a size argument in {2, 3, ..., 15} and places a few chess pieces on the board for good measure. The pieces are not placed logically.
Also, since the pieces are placed randomly with a probability of P(1/2) that any one square will have a piece on it at all, it will be observed that very small boards (eg, 2x2) will sometimes appear to have no pieces on them at all. This is not a bug, it is expected behaviour, given that on a 2x2 board, with only two white squares, there will be no pieces 1/4 of the time (probably).
The chess .gifs are black, and do not show up on the black squares. This is also expected behaviour, and should not be a cause for alarm.

StopLight.java
This is a simple applet that lets you play with the traffic light. To make it a little better looking, I tried using some methods from the java2D API.




© 2003 - pcrissman & revividus.com