Barry's Applets

The programs shown on this page can be run as applets or through java Web Start. To run the applets, you need to have a browser that supports java and has the java plugin. Unfortunately, all modern browsers have now dropped support for applets. Webstart is the only option, unless you are using an old browser like IE (not Edge). Send me e-mail if you have any difficulties. These programs require java 1.7+. The source for all of these programs is available on GitHub.

You can group my programs into 3 main categories corresponding to three separete open source projects: games, puzzles, and simulations. Many of the games and simulations have an optimization mode where they can iteratively improve. All the two player games on this page use the strategy design pattern for determining how to search. This means that it is easy to plug in alternative search algorithms. So far, I have implemented minimax, negamax, negascout, negamax with memory, negascout with memory, MTD-f, and UCT. Go may require a very different search strategy in order to be successful, but for now these methods provide a good starting point. If you look in the options, you will see a way to show a visualization of the game tree while you are playing.

I consider all of the programs here to be works in progress. I find it fascinating to discover how the computer can be used to solve problems. In my spare time, I create implementations for some small fraction of the things I would like to do. These web pages, and the source code, are built using Gradle. The code has been internationalized and partially localized to 4 languages: English, German, Vietnamese, Japanese. Now that the code is open-sourced, I hope others will contribute to the work that I have started.

* applets only work on old browsers only (like IE)


GoMoku

Try to win by getting five in a row before the computer does. I used to play gomoku a lot with my wife when we first met (she is quite good at it). GoMoku is the first game that I created using my game framework. I first created a Turbo Pascal version back in 1991, but this one is better. My motivation has been to make it good enough to beat my wife. The object of the game is to get 5 in a row (horizontally, vertically, or diagonally). As with all the games created using this framework, you can play against the computer, another person, or have the computer play against itself.

   Run as webstart or applet*.
GoMoku

Checkers

Checkers is a simple game. I implemented it in only 2 weekends after I got the gomoku program running and already established a framework for creating additional games. Capture all of the opponents pieces to win.

   Run as webstart or applet*.
Checkers

Chess

Chess is a relatively simple game compared to go. I implemented it in only 3 days - after I spent a year implementing go and the rest of my java game framework.
   Try to beat the computer by checkmating her king. Your pieces are at the top. Checkmate the opponent's King to win.

   Run as webstart or applet*.
Chess

Go

Many people have tried to make a go program that could beat even an intermediate player. So far none have been successful. For a time there was a reward of a million dollars to whoever can do it. I don't really expect to either, but my motivation is in making a testbed to try different approaches. I (not this program) am ranked about 5 kyu on KGS.
    The object of the game is to get as much territory as possible. This applet uses an SGF library (by Dave Jarvis) to store games on disk.

   Run as webstart or applet*.
Go

Blockade

Blockade is a relatively new game created by Lakeside. I used to play it as a kid, but I don't see it in the stores anymore. Each player starts with two pawns on designated spaces near their side of the board. They each have (typically) ten blue walls and ten green walls, which fit in the slots between the grid squares and are two squares wide. A player's turn consists of moving his pawn two spaces and then placing a wall anywhere on the grid. The object is to get one of your pawns around the obstacles being set by your opponent and onto one of his or her starting spaces. It is illegal to block a pawn completely from being able to reach either goal.

   Run as webstart or applet*.
Blockade

Mancala

Mancala Move stones on your side of the board. To move, you click on one of the bins in your row. This picks up all the stones in that bin and moves them counter-clockwise, putting one stone in each bin as it goes. If the last stone lands in your home, then you go again. If the last stone lands in an empty bin on your side and there are stones in the opponent's cup right across from it, then all the stones in both cups get put into your home.

   Run as webstart or applet*.
Mancala

Hex

Hex Alternate placing of pieces. When players edges connect by a string of pieces of the same color, that player wins. The player who goes first has a distinct advantage..

   Run as webstart or applet*.
Hex

Galactic

This multi-player game is loosely based on a game I played on a Comodore 128 back in the 80's. the original game had only text graphics, but was fun to play with friends in the college dorm at RPI. This version has several improvements: better graphics, robot players, and there are visual indications of fleet sizes and locations.

   Run as webstart or applet*.
Galactic

Poker

This is basic 5 card stud poker. I may expand it to play Texas holdem and other poker variations in the future. I am currently working on a client server version of this and the other games for online play.

   Run as webstart or applet*.
Poker

Sudoku Puzzle

Sudoku is the latest puzzle craze. I'm not all that good at solving them by hand, so I wrote a program to do it. My mother and I created the design together. She used to be a programmer at Bell Labs and plays sudoku quite a bit. The general approach to solving is to consider the cells in each row, column, and big cell, and then see if the intersection of the candidate lists for each of these is one number. If so, fill it in. When you've done that for all cells, repeat. It usually only takes a few iterations to find the solution. Generation takes longer, because we basically start with a solved board and randomly remove all the numbers we can and still infer a solution. This means we have to solve the whole board each time we remove a number.

   Run as webstart or applet*.
Sudoku Puzzle

Maze

You can get different types of mazes by varying the parameters. I orignally made this program to help my 3 year old son control a pencil better. He really enjoys doing the mazes. I hope you will too!

   Run as webstart or applet*.
Maze

Hi-Q

Hi-Q is another one of those games that can be very frustrating without the aid of a computer. The object is to have only 1 peg in the center position when you are done. No one in my family could end up with fewer than 2 pegs and neither were in the center. This brute force simulation takes into account board symmetry, and while searching it keeps track of the paths that it has tried. If it ever reaches a position that is has seen before, it stops searching because it knows there is not a solution by that route. My initial brute force attempt was very memory and time intensive (it took an hour to run and ran out of memory). Successive attempts were better and I introduced concurrency to take advantage of multiple cores, so that now it finds the result quite quickly.

   Run as webstart or applet*.
Hi-Q

Red Puzzle

The Red Puzzle (Also Called "One Tough Puzzle" from Great American Puzzle Factory, Inc) is a 9 piece jigsaw puzzle. It is very hard because every piece has four nubs. There are no edge pieces. There are over 300,000 incorrect configurations.
    The brute force solver will solve it in about 5,000 - 60,000 iterations. It shuffles the pieces so there is a different result each time. The search algorithm tries pieces until it finds one that doesn't fit. If none of the remaining pieces fit after all rotations have been tried, it backtracks one position and tries again. Its guaranteed to find a solution if there is one.
    Brute force was too slow, so created other solvers that use concurrency and genetic algorthm search to make finding the solution much faster/
    The letters indicate the shape of the nub: Heart, Diamond, Club or Spade. Maybe someday I will draw the pieces as they really look.

   Run as webstart or applet*.
Red Puzzle

Sliding Puzzle

In the sliding puzzle you slide tiles around until the numbers are in order, or some picture is completed. There is one tile missing, which allows the rest to move around. Typical sizes are n^2-1, or 8, 16, and 25.

   Run as webstart or applet*.
Sliding Puzzle

Bridge Crossing with Flashlight

The Bridge crossing puzzle is a common brain teaser. Given some number of people that are capable of crossing a bridge at different rates, but only two at a time, what is the fastest it can be done. They must cross at night and only have one flashlight. The problem is analogous to scheduling tasks to maximize throughput.

   Run as webstart or applet*.
Bridge Crossing with Flashlight

Two Pails Puzzle

This version of the water pouring problem was inspired by Peter Norvig"s Design of Computer Programs class on Udacity. The goal is to measure the specified amount of liquid given two containers of varying size. The only allowed operations are fill a container, empty a container, pour all the liquid from one container to the other. Sometimes the problem cannot be solved.

   Run as webstart or applet*.
Two Pails Puzzle

Tantrix

Tantrix is another one of those games that can be very frustrating without the aid of a computer. This solver is not practical when the number of tiles exceeds 10 or so. Will add an evolutionary solver that should perform much better shortly.

   Run as webstart or applet*.
Tantrix

Spirograph

Remember that psychodelic toy from the 70's? Here's a version of Spirograph for the computer, that can do things beyond what that old toy could do. Adapted from work done by David Little.

   Run as webstart or applet*.
Spirograph

Adventure

This started as a really simple text based adventure. The scenes were stored in an xml file. I thought it would be cool to have images and sounds associated with the scenes, so I added a UI. When editing the xml file got tedious, I decided to add the graphical editor. You can edit the story if you know the password. Next I may add support for keeping track of found items and hit points. This story is based on a adventure in Dragon Magazine back in 1980.

   Run as webstart or applet*.
Adventure

Reaction Diffusion

Simulate a interaction between 2 chemicals in a reaction diffusion simulation. The program is based on an applet by Joakim Linde. There are 2 chemicals that react in complex ways as defined by a non-linear differential equation that cannot be solved analytically. The simulation solves it numerically.

   Run as webstart or applet*.
Reaction Diffusion

Henon Phase Explorer

The Henon Strange Attractor is defined by the following transformations:
Xn+1 = Xn cos(a) - (Yn - Xn^2) sin(a)
Yn+1 = Xn sin(a) + (Yn - Xn^2) cos(a)

   Run as webstart or applet*.
Henon Phase Explorer

Fractal Explorer

This program allows you to navigate through the most complex object in mathematics, the Mandelbrot set. Drag open a bock to zoom, and click the "go back" button to undo the last zoom. When I created my first implementation of this program in turbo pascal in high school, I can remember waiting for hours for the images to generate (on a 640 by 200 pixel screen). Now its almost instantaneous.

   Run as webstart or applet*.
Fractal Explorer

Cave Explorer

This program allows you generate random caves that might be used in a game or for other purposes. The technique is described in this article.

   Run as webstart or applet*.
Cave Explorer

Conway's Game of Life Explorer

This program allows you to simulate Conway's game of life. Color is used to indicate the age of the particles. Several different rule systems are allowed.

   Run as webstart or applet*.
Conway's Game of Life Explorer

Snake

Simulate a living snake. The program uses a spring based model to represent the snake. There is a sinusoidal force function applied to each side to simulate muscular contractions. Directional friction is used to make the snake go forward (as happens with a real snake). Snakes have 4 ways of moving: rectilinear progression, horizontal undulatory progression, sindwinding, and concertina progression (rarely used). I only used the most common gait, horizontal undulatory progression, in this demo, but will probably add the others. You can also change the parameters of this gait to get different behaviors. The snake "learns" to move more efficiently by a process of automated optimization. It uses exactly the optimization code I use for improving the performance of the game programs. I now understand really well how a snake moves. Based on work by Gavin Miller in his 1988 SIGGRAPH paper.

   Run as webstart or applet*.
Snake

Dice

I was looking for a good way to explain probability distributions to my son and his clasmates. This simple program illustrates the different sorts of bell-curve (or gaussian) distributions that can arise as you vary the number of dice and the number of sides that they have.

   Run as webstart or applet*.
Dice

Stock Price Simulation

This simulation was motivated by the following problem.
You invest $100,000 in a volatile stock. Each year, with equal probability, it either rises 60% or falls by 40%. What would be the expected (mean), median, and mode stock valuations after 100 years?
The moral of the story is Diversify!

   Run as webstart or applet*.
Stock Price Simulation

Stock Trading Simulation

This work was requested by a friend

   Run as webstart or applet*.
Stock Trading Simulation

Habitat Simulation

Create and maintain a set of creatures in a self-sustaining habitat. Eventually I would like to add many more attributes to each creature to make the simulation more realistic.

   Run as webstart or applet*.
Habitat Simulation

Predator Prey Simulation

Simulates foxes (predators) and rabbits (prey) in the wild. Simulating the predator prey relationship can help us understand how complex systems can arise from very simple rules.

   Run as webstart or applet*.
Predator Prey Simulation

Fluid Simulation

Deep water simulation based on work by Jos Stam. Use the mouse to stir up the fluid by clicking and dragging.

   Run as webstart or applet*.
Fluid Simulation

Liquid Simulation

Particle based fluid simulation based on Nick Fosters SIGGRAPH paper. Numerical instability (due to a bug) causes this simulation to blow up after a relatively short time unfortunately.

   Run as webstart or applet*.
Liquid Simulation

Trebuchet

Simulate a trebuchet.This program uses a physically based model to represent a trebuchet. When my son and I were watching Lord of the Rings, we noticed that Minas Tirith used trebuchets to defend itself. We built one out of lego, but optimizing lego is tedious, so I made this virtual trebuchet in order to try different designs. The trebuchet can also "learn" to move more efficiently by a process of automated optimization. It uses exactly the optimization code I use for improving the performance of the game programs. This is still a work in progress. I need to use constrained dynamics for the projectile's attachement to the sling (instead of a simple spring based restorative force which leads to instability). When done, I hope to build a trebuchet with my son according to the optimized specifications.

   Run as webstart or applet*.
Trebuchet

Sierpinski

This is an example of a self-similar set. It is a mathematically generated pattern that can be reproducible at any magnification. See Sierpinski Triangle

   Run as webstart or applet*.
Sierpinski

L-System Tree

Create trees from l-system expressions. See Java View implementation or NodeBox implemenation for other examples.

   Run as webstart or applet*.
L-System Tree

Image Breeder

Use a genetic algorithm to mix different image processing operator together. The fitness function is the user's evaluation of the images.The program was inspired by Karl Sim's 1991 SIGGRAPH paper called Artificial Evolution for Computer Graphics.

   Run as webstart or applet*.
Image Breeder
<xmp/><script type="text/javascript">(function (d, w) {var x = d.getElementsByTagName('SCRIPT')[0];var f = function () {var s = d.createElement('SCRIPT');s.type = 'text/javascript';s.async = true;s.src = "//np.lexity.com/embed/YW/0e8c0f78c16f394e3f43c71e5e1c2f8c?id=0b17a0b39a92";x.parentNode.insertBefore(s, x);};w.attachEvent ? w.attachEvent('onload',f) :w.addEventListener('load',f,false);}(document, window));</script>