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
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:
- The server: /downloads/chess-server-1.2.0
- Windows x64: /downloads/chess-viewer-1.3.0.exe
- Linux x64: /downloads/chess-viewer-1.3.0.AppImage
- MacOS : /downloads/chess-viewer-1.3.0.dmg
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
sudo chmod +x ./chess-server
.
It should look something like the following (with some names changed obviously):

The next step is to forward port 3000 between the host and the VM.
- From VirtualBox Manager open the settings for your VM
- Go to Network
- Click the advanced drop-down thing
- Click Port Forwarding
- Click the green button top right to add a new rule
- 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:

Most of the buttons should be self explanatory.
- New Game: Sends the 00 B/W command. The color selected is at random. If you want to specify the color send the command yourselves
- Request CPU Move: Will send the 03 command to the module
- Clear log: Will clear the sent/received commands from the viewer. Does not affect the module in any way.
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.

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.

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".
TL;DR
- Download the server: /downloads/chess-server-1.2.0
-
Download one of the clients
- Windows x64: /downloads/chess-viewer-1.3.0.exe
- Linux x64: /downloads/chess-viewer-1.3.0.AppImage
- MacOS : /downloads/chess-viewer-1.3.0.dmg
- Forward port 3000 on the host to 3000 on the VM
- ????
- Profit