Skip to content

Latest commit

 

History

History
53 lines (32 loc) · 2.7 KB

File metadata and controls

53 lines (32 loc) · 2.7 KB

Java Chess Game - 2021 v1.3.2

This open-source Java Chess Game was my very first "real" programming project outside of the classroom, created after finishing my first Intro to Algorithm classes at MTC back in 2021, just before I began attedning USC. Bluntly, I was never particularly any good at chess, never having put in the required time nor effort to master the game; the lack of which was often exploited when playing against my younger brother.

This program was a way for me to finally beat him at his own game; using computers to do the work I really ought to have done in my head. Regardless, I finally had my revenge, beating him for the first and only time.

I haven't played chess since.

Game Image

I built the game using UTF-8 characters to represent chess pieces, which felt extremely clever at the time. The interface went through a litany of tweaks as I tried to mimic a modern Windows GUI, even despite me testing it on two ancient Windows XP machines. Those computers ran like molasses, but figuring out how to connect them via IP addresses so we could play against each other from different rooms in our house was pretty cool at the time.

The primary feature (and reason I built the program) I managed to put in was a move-suggestion system, which hinted at the best moves, or warned you about the worst ones. I also included a predictive simulator to guess your opponent's next move, adding some strategic depth. The code wasn't perfect, and looking back, it makes me cringe a little, but that's part of its charm.

Today, this repo is the only video game I've decided to keep on my GitHub acct. It reminds me of a simpler time before I had to be an adult, a time filled with late-night coding sessions, sibling rivalries, and even building a go-kart before heading off to the University of South Carolina. I've left it open-source, partly out of nostalgia, and partly in the hope that others might find amusement in my first stab at making a real game.

Features

  • Single-player and multiplayer (LAN) modes via TCP sockets
  • Move suggestion system that hints at best/worst moves
  • Opponent move prediction simulator
  • UTF-8 chess piece rendering
  • Swing GUI with legal move highlighting

Requirements

  • Java 8 or later (JDK for compiling, JRE for running)

Building and Running

All source files are in the game/ directory.

cd game

# Compile
javac *.java

# Run directly
java BoardGUI

# Or package as a JAR
jar cvfm BoardGUI.jar bin/manifest.txt *.class
java -jar BoardGUI.jar

Multiplayer

To play over a local network, run Server.java on one machine and Client.java on the other, connecting via IP address.

License

MIT