CS212 Problem Sets


Just for Fun

WARNING: You must finish the problem set, in its entirety, before doing any of this fun stuff. We will only consider any extra credit if your core problem set meets a certain standard. That is, if your problem set solutions don't work, don't bother doing the extra credit - we won't even look at it.


Extra Credit - Game Enhancement Contest

We hope you have had as much fun doing this assignment as we had putting it together. Now is your chance to show off your newly acquired skill in object-oriented programming and your creativity. For this contest, we would like you to enhance the program in any way you wish by implementing some feature of your own design.

Suggestions:

You can do anything you want here. The sky is the limit! Please hand in a complete stand-alone program (make sure it is well commented) and a short written description of what you did. This submission is separate from your problem set, and there is a unique key for this in the submission system.  See the submission page for more details.

As before, programs will be judged by the CS212 staff, and the winner will receive a prize.


Networking

NOTE: While we've tried to debug server/client code as much as we can, it is terribly difficult to catch everything. So, be aware that we are not providing assistance with this. If you run across a bug or difficulty - tough luck. We cannot support this because we neither have the resources nor the time to deal with any problems regarding networking.

The way this game is designed, it is fairly easy to add networking capability to it. While an involved explanation of networking this game is beyond the scope of this course, we can give you a overall view. Important to adapting this game into a network version is the idea of a thread. Threading essentially allows a program to run several processes at once.

After finishing the problem set, you should understand how important the main event queue is to running the game. The server essentially puts that main event queue into a thread. Thus when you run the server, you will be able to still use Swindle while the game is running. When a connection to the server is made, additional threads are created for each player. This is about as detailed as we will get with this discussion, but if you're really interested, come to office hours and we can talk some more.

Now on to actually starting the server. First start by opening the console version of Swindle (not DrSwindle). We use the console version because it does not have the added complexity of a GUI. Then load the problem set and perhaps your solutions. After loading any files you want, evaluate (server). The following is a what should happen:

Welcome to Swindle.
==> (load ps5)
==> (server)
Server is ready and waiting for connections on port 12321
#<thread>
==>

If you don't get this type of session output, then your server isn't running correctly. Port 12321 is the port that we chose for running this game. Notice how you are now back at a prompt - you can evaluate a Swindle expressions while the game is running.

Now that the server is running, you can connect to it using the server. To do this, again open Swindle in the console and evaluate (load client). Alternatively, if you are using windows, you could use this as run-line command:
"c:\Program Files\PLT\mzscheme.exe" -f "Program Files\PLT\collects\Swindle\cs212\ps5\client.ss"
Once, you start the client, you'll be asked for the IP/DNS address of the server. You should know this. A good session looks something like the following:

Welcome to Swindle.
==> (load client)
Enter the host name or ip address (no spaces): 128.253.97.98
Trying to connect to 128.253.97.98
Connected to server.

Welcome to the Quest for the Holy Grail!

Note that you can now play the game. So now you can even play the game in teams - have a party. Forget Doom & Quake, now you have Monty Python.

If you have friends away from Cornell that you want to play the game, you can start the server and have them telnet to the server. Unfortunately, the only telnet that works is the Unix telnet (sorry Windows). Basically, to telnet, you need to type:
telnet [ip-address] 12321

So, as soon as you finish the problem set, you can waste all your time fiddling with the server. Have fun!!