Computer Science Projects

Zach Jaffe-Cotter

contact: zswimz@yahoo.com

 

 

You can view each of my projects by clicking the links below.  If they do not work, you need to install the Java Runtime Environment, which can be found here.

 

Mandelbrot Fractal - This program is an applet, so it can be run online without download. The Mandelbrot Set is created using the recursive formula z = z2 + c, where c and z are complex numbers.  C is in the Mandelbrot set if z always remains within two units of the origin of the complex plane.  The set is colored black and each point outside the set is colored based on how many iterations it takes to determine that c is not part of the Mandelbrot set.

To zoom in, click and drag over the area you want to see, starting in the upper left hand corner and ending in the lower right hand corner. Then press zoom in.  Zooming out shows you the same image you saw before at the next lowest magnification.  The first link will run the applet using a faster, less precise algorithm to draw the fractal.  In the faster version, each image is created using up to 163,200,000 calculations (255 for each pixel), so it will take a minute or two to draw a picture on most computers.  The second link runs a slower, more precise version of the program that uses all 16,581,375 colors available in RGB color mode. Each image requires up to 979,200,000 calculations, so it will take 5-8 minutes to draw on most computers.  The closer the area you are trying to zoom to is to the black parts of the image, the longer it will take to draw the new image.

CLICK HERE TO RUN THE FAST MANDELBROT FRACTAL PROGRAM

CLICK HERE TO RUN THE SLOW MANDELBROT FRACTAL PROGRAM

 

Koch Fractal - This program is an applet, so it can be run online without download.  It creates a Koch snowflake, which is based on the Koch curve created in 1904 by a mathematician named Helge von Koch.  The Koch curve can be created with the following line segments arranged as shown:

Each line segment is then replaced with a smaller version of the whole picture.  This pattern can be repeated recursively.  My program draws three Koch curves arranged in a triangle to form a Koch snowflake.  As the scroll bar at the bottom is dragged to the right, the number of recursive iterations shown increases.  I limited the number of recursive iterations to 6.  The length of the line segments decreases at each iteration.  Once the length of each line becomes less than 1 pixel, it can no longer appear on the screen.  Additionally, the length and position of each line segment must be rounded to an integer before they can be displayed on the screen.  As the length decreases the effect of the rounding errors increases, which eventually skews the fractal as it appears on the screen.

CLICK HERE TO RUN THE KOCH FRACTAL PROGRAM

 

Maze - This program is an applet, so it can be run online without download.  The maze program allows you to create a virtual maze for the computer to navigate.  The black square you see when the program starts is really a 10x10 grid of squares.  Clicking one of these squares will turn that space white.  A second click will turn it green, and a third click will turn it red.  The fourth click on the same space starts the cycle over again.  The black spaces represent the wall of the maze, while the white spaces are the paths.  Green or red spaces indicate the beginning or end of the maze.  Once you have created a path between the beginning and end, clicking solve will cause the computer to trace its path in blue.  Example screenshots are shown below.

CLICK HERE TO RUN THE MAZE PROGRAM

 

 

 

Blackjack – This is a simple blackjack applet, which can be run online without download.  Click deal to start.

CLICK HERE TO RUN THE BLACKJACK PROGRAM

 

Risk - This multiplayer game is based on the board game Risk.

Click above to download a zip folder containing a computerized version of the board game Risk that I wrote in Java.  (Once you download the file you must extract its contents by right clicking it and clicking extract all).  
The folder contains five sub folders, four of which contain executable jar files (java programs) which you can run by double clicking. 

CLICK HERE TO DOWNLOAD THE RISK GAME

 

The contents of the Risk folder are described below:

- The "Risk Standard Game" folder contains a file called Risk.jar.  Double clicking this file will start a Risk game on a map of the world.  If do not know how to play the board game, you can find instructions here.  There are five human players each represented on the map by a different color.  In my game, the red player goes first.  Clicking a red country will place a single army on that country.  The number of armies remaining is shown in the bottom left hand corner.  When there are no armies remaining, you can click done to move to the next player.  You can see whose turn it is by looking the dot in the upper left hand corner of the screen.  Once each player has placed their initial 20 armies, the first player starts their turn by placing several more armies.  When they press done, they begin normal game play.  Click one of your own countries to select it, and then click a neighboring country to attack it.  The dice roll is not visible to the user, but is simulated using a random number generator (java.util.Random).

 

 

- The "Risk Mini Game" folder contains a file called Risk.jar.  Running this file will open a Risk game on a simple map with only 5 countries.

- The "Risk Map Builder" folder contains a file called RiskMapBuilder.jar, which can be run to create your own risk map on a custom image.  Instructions for this can be found in a text file located in the same folder.

- The "Risk Custom Game" folder contains a file called CustomRiskGame.jar which allows you to run a game created by the Map Builder.  Instructions for this can be found in a text file located in the same folder

- The "Risk Code" folder contains all the code I wrote for this game. 

 

Stratego – This is a two player game based on the board game Stratego.

Click the link above to download a zip folder containing the game files.  Once you download the file you must extract its contents by right clicking it and clicking extract all.  The folder contains an executable jar file called Stratego.jar.  Double clicking this file will run the game.  Choose the new menu and select offline game.  If you do not know how to play the board game Stratego, you can find the rules here.

CLICK HERE TO DOWNLOAD THE STRATEGO GAME

 

The first player can place their pieces in the window that appears.  Clicking a square will place the piece shown in the image in the bottom left corner in that space.  Moving the scrollbar at the bottom allows you to choose which piece to place.  Placing a new piece on top of another piece removes the bottom piece from the board.  Clicking the remove button allows you to remove pieces you have already placed by clicking them once.  When you have placed all your pieces, you can click the done button to allow the next player to place their pieces.

 

 

When both players have placed their pieces, the game board will appear.  Whoever placed their pieces first makes the first move.  Clicking one of your pieces selects that piece to be moved.  Clicking the same piece again deselects it.  Clicking an adjacent space will move the piece there or attack if possible.

 

Choosing the online game mode in the initial window allows you to start a game in which each player is at a different computer.  You can connect the two computers for the game by entering their names or IP addresses.  You can find the name of your computer by right clicking the My Computer icon on your desktop and choosing properties.