Chess Viewer

A tool to help you interact with your chess driver and visualise the state of your driver.


  • Version 1.3.0 - Will now show a message if there is a newer version
  • Version 1.2.0 - Now allows two different ways to view the board
  • Version 1.1.0 - Now supports connecting to specific endpoints
  • Version 1.0.1 - Add '\n' to the end of commands
  • Version 1.0.0 - Initial Release
  • Version 1.2.0 - Will now show a message if there is a newer version
  • Version 1.1.0 - Now supports extra credit
  • Version 1.0.2 - Fixed king and queen icons
  • Version 1.0.1 - Fixed board layout bug
  • Version 1.0.0 - Initial Release

Take me to the full instructions TL;DR

Set Up

The viewer is made up of two components. A server and a client. This allows you to use the client outside your VM with your native OS and screen resolution.

The first thing you need to do is download the executables. You will need:

And one of the following depending on your host OS. This will be the "viewer" or client: Notice that you can use the linux executable inside your VM if you so chose.

Copy/move/download the server file in your VM. You can place it wherever you want, for example ~/chess-server. You can run it as a normal executable from your terminal:

            
              cd ~/chess-server
              ./chess-server
            
          

It should look something like the following (with some names changed obviously):

the server running

The next step is to forward port 3000 between the host and the VM.

  1. From VirtualBox Manager open the settings for your VM
  2. Go to Network
  3. Click the advanced drop-down thing
  4. Click Port Forwarding
  5. Click the green button top right to add a new rule
  6. Fill in the Name with whatever you want, Host Port and Guest Port with 3000

Usage

Server

You do not need to do anything else with the server. It will provide you with messages that might help you debug your module though. So keep an eye on it. Newlines in your input/output are preserved!

Client

As we've said, you can use the client straight from your Host OS assuming you downloaded the correct version, and it should look something like this:

The client runnirg

Most of the buttons should be self explanatory.

You can type commands in the input field, hit enter or the send button to send them. The viewer will send the command as you typed it with a '\n' at the end. The response you get back is exactly what your module returned from read(). The viewer does no validation and does not perform any logic whatsoever. Also make sure to check the server executable from debug information!

Chess pieces

After popular demand there are two ways to display the board now. You can change the view by using the toggle on the top right.

The first view is the "normal" view that you would see if you were playing in a real chess application. It shows the black pieces on the top of the board and the white pieces on the bottom. It also abides by rules like "queen on her own color". You can see an example of that below.

Board Layout

The other way is the one that was used up until now, and it is called the "debug view". It will show you the pieces in the order you return them after a 01 command. This should result in a mirror of the previously described view. You can see an example of that below.

Board Layout
The viewer will not attempt to create a correct view out of the data provided. If you do not provide the state in the correct format, you will get wrong results.

FAQ

Q: Nothing happens when I send commands

A: Make sure the server is running inside your VM. You should also check the server for any debug output.

Q: I am doing the extra credit, can this thing help ?

A: Yes, you can start one server instance, per game you want played. You then connect to that instance from any number of viewers. Here's a quick guide:

  • Start a server instance on some port chess-server portnumber
  • Start one or more instances of the viewer. You can connect to a specific server by typing the command /connection http://localhost:portnumber
  • Now all your commands will be sent to the server (and the game if you have implemented that part of the extra credit) matching port "portnumber".
You will also need to forward any additional ports you are using, just like you did in the original setup

TL;DR