April 20, 2008

Some more Subship

I've put the latest version of subship in a public repository on Github so it will now be current with whatever work I'm doing. This will make it much easier to update. From now on, I'll store all of my projects this way.

Labels: , , ,

March 13, 2008

Subship pt. 2

Ok, It's been a little while but I've been busy. No, I've not been busy on my thesis or work; I've been chasing important things, like tiny mini-video games. Specifically, I've been working on implementing my subship game. I've nearly completed the primary engine and I'll upload the source code in a little while so folks can try it out. It's written in lisp so you'll need an instance of Clisp to run it in or something similar. It runs through an overly simple command-line interface so it will seem rather crude, and it is (not as crude however, as the current AI.) However, this is not the final cut. I plan to implement a clean interface in JavaScript and place the engine in a CGI script so that I can implant the game in my homepage. I also have a scheme for designing rather more sophisticated AI algorithm and come mid summer it should be pretty cool.

In other news, I did finally begin writing my thesis. I'm not so sure what has taken me so long; it is probably my innate tendency to procrastinate. It seems like it might be easier than I thought, at least the first chapter will be. All I have to do is echo the same things OSS advocates have written about ad nauseam and add my own clarifications and qualifications. I hope to get it done in a reasonable amount of time.

Thank you and God Bless.

Labels: , ,

January 9, 2008

Subship

I've come up with an idea for an interesting alternative game of battleship. I call is sub-hunt. Each player only has one piece each, either a sub or a destroyer and each only takes up one square. The player's pieces start out several squares away from each other facing random directions. The players cannot see the location of their opponent's pieces unless told. The players then take turns. On his turn, a player has one of three options: move, attack, or up-parascope/ping. If a player chooses to move, he can move in any direction, exactly one square, or remain in place. If he chooses to attack, he must announce the location and orientation of his piece aloud. Then, depending on whether he is the sub or the destroyer, his opponent signals whether he was hit or not. If he is the destroyer, the sub is hit if it occupies the same square as the destroyer. Else, if he is the sub, the destroyer is his if it stands in the current path of the sub. Hits can be tallied for a win. If the player chooses to ping/up-parascope, both players must then announce their locations.


A quick example game:

Whatsay a game starts with this position:
/ - - - - - \
| * * * * * |
| * s * * * |
| * * * * * |
| * * * d * |
| * * * * * |
\ - - - - - /
Neither player is aware of the location of the other player.

Assuming it is the destroyer's turn first, he can move, attack, or ping. Let's say that he moves:
/ - - - - - \
| * * * * * |
| * s * * * |
| * * * d * |
| * * * * * |
| * * * * * |
\ - - - - - /
Still, neither player is aware of the location of the other player.

Now it is the sub's turn and he has the same options. Let's say that he up-parascopes:
/ - - - - - \
| * * * * * |
| * s * * * |
| * * * d * |
| * * * * * |
| * * * * * |
\ - - - - - /
The map is the same, but both players have to tell the other where their piece is.

It's the destroyer's turn and he moves:
/ - - - - - \
| * * * * * |
| * s d * * |
| * * * * * |
| * * * * * |
| * * * * * |
\ - - - - - /
At this point, the destroyer still knows where the sub is, but the sub only knows where the destroyer has been. He can guess where the destroyer has just moved to, and he knows where the destroyer could not have moved to, but he doesn't know for sure. There are exactly nine square where the destroyer might be. The sub is currently pointed in the 4:30 direction (down and to the right.) This covers two of the possible squares so if the sub chooses to fire, he has a two in nine chance of hitting the destroyer:
What the sub knows: The sub's chances:
/ - - - - - \ / - - - - - \
| * * * * * | | * * * * * |
| * s . . . | | * s . . . |
| * * . . . | | * * + . . |
| * * . . . | | * * . + . |
| * * * * * | | * * * * + |
\ - - - - - / \ - - - - - /

So, the sub has one of two choices, either fire and hope to hit the destroyer, or move, and hide from the destroyer. Our sub decides to hide and moves down one:
/ - - - - - \
| * * * * * |
| * * d * * |
| * s * * * |
| * * * * * |
| * * * * * |
\ - - - - - /

This would continue until one or the other scored enough hits on the other to constitute a win.

Labels: , ,