P2P Connect-Five Game in Python and PHP

One of my three electrical engineering electives for this final semester is ECE 463: Introduction to Computer Communication Networks. About two weeks ago, we were assigned a final project: Design a P2P Connect-Five game that communicates using the HTTP Protocol.

My partner, Jun Lin, and I quickly decided to use Python for the client-side GUI, since I had done a fair amount of GUI work in the course of my internship this past summer. We opted for Python 3 and used the Anaconda distribution. I did nearly all the Python GUI with the use of tkinter. Because the Spyder3 IDE was taking more time to adjust to than Spyder 2, I ended up relying on Bare Bones Software's BBEdit text editor--the power of which I am now beginning to appreciate--and Mac OS X Terminal. That was it!

Jun Lin worked some magic--the only word I can use, since I know nothing about PHP--for the server-side scripting. Initially we ran the server off my GoDaddy shared hosting account, but we found that it would block us after too many accesses from the same IP addresses. That forced us to turn to a different host, which we happened to have.

Anyway, we will demonstrate the game in class on Wednesday, but I wanted to put up some screenshots. I plan to make my Python GUI code available online at some point, because it would surely be helpful to others.

The following screenshot show the game at startup. We were required to have a 19x19 game board. I opted for check buttons, because they are easy to work with and make nice arrays.

screen

The other screenshot shows a win. Every time black--you (peer is pink)--makes a valid move, my algorithms scan for a vertical, horizontal, SW–NE, or NW–SE win. If one is found, the peer is notified of their loss and scores are updated accordingly. If the peer logs out midway, that is correctly handled. We are rather proud of our game!

victory

A Pleasant Day

Though it began with my reluctance to depart for school, the day turned out to be a very good one for a couple of reasons:

  1. I was able to figure out viable algorithms for Connect 5, our peer-to-peer final project in ECE 463.
  2. Purdue's main campus will let me attend Commencement up there.
  3. A friend called to thank me for passing along the contact information of a recruiter who has since hired him. He is excited about moving to Michigan to work.
  4. Another friend I had not seen in a while happened by and said he had heard good things about my growing programming skills. They are definitely better, but they are still low.
  5. My 463 partner found out how to use the old PHP 5.3 that my hosting arrangement provides, which will allow our P2P game to work nicely.

Additionally, it was unseasonably warm: 71°F.

Election Day, 2016

After my morning class, I took my girlfriend up to vote. The line for our district was quite short, so we whisked right inside. It was nice to see people exercising their rights to determine the future course of government at all levels.