Fool’s Mate Friday: My Favorite FICS Commands



Last week we talked about Jin and FICS a bit, but I wanted to make a post to break down some of my favorite FICS commands, which help show why I like to use it for playing online chess. Don’t worry, we’ll be getting back to our chess programming project soon!

  • messages

I like the messages command to send or view messages from other players. One of the things I like to do is ask players who beat me for some advice. Granted, I don’t always get quality advice, sometimes I actually get rather rude responses, but occaisionally I’ll get something useful from another player. I can send a message like so:

messages OtherPlayersName This is my message.

It’s that simple. To check my messages, I just type:


That shows me the list of messages I have, and then I can say:

messages 1

To view message number 1. Pretty simple, I know, but I find this useful.

  • history

Typing the history command shows me all the games I recently played. Like this:

History for alaskalinuxuser:
Opponent Type ECO End Date
84: + 1147 W 1153 javikibera [ br 5 3] D00 Res Fri Jan 26, 12:32 AKST 2018
85: + 1393 B 1386 trapik [ sr 15 10] B51 Mat Fri Jan 26, 12:52 AKST 2018
86: – 1125 B 1475 Nedbio [ lr 2 0] B20 Mat Sat Jan 27, 05:30 AKST 2018
87: – 1390 W 1654 ChesstaLaVist [ sr 15 0] A02 Mat Sat Jan 27, 05:52 AKST 2018
88: – 1139 B 1141 CyberXess [ br 12 0] B23 Mat Sat Jan 27, 06:07 AKST 2018
89: – 1132 W 1214 GOROWITCHES [ br 12 0] D00 Res Sat Jan 27, 06:26 AKST 2018
90: – 1125 W 1174 Tordan [ br 5 0] D00 Mat Sat Jan 27, 20:16 AKST 2018
91: – 1118 B 1155 fridayknights [ br 3 0] C41 Fla Sat Jan 27, 20:29 AKST 2018
92: – 1108 W 1063 qrtroimaclic [ br 10 0] A02 Mat Sun Jan 28, 06:06 AKST 2018
93: + 1117 B 1132 Chessonator [ br 10 0] D00 Res Sun Jan 28, 07:36 AKST 2018

You can view past games with history, but only the last 10 games.

  • mailstored

I use mailstored with my history output to email myself my games. The email will include all the moves made during the game, the times, who won, etc. This way I can store and review all of my games in my own email. Use it like this:

mailstored alaskalinuxuser 93
Moves mailed.

Now I emailed all the details from game 93 to my email box, which I can keep forever.

  • finger

This command lets you review another players stats, like reviewing a player named “top”:

finger top
Finger of top:

Last disconnected: Sat Feb 21, 01:19 AKST 2004

rating RD win loss draw total best
Blitz 1908 350.0 122 101 18 241 1917 (06-Nov-1995)
Standard 2074 350.0 14 4 1 19

1: Torben Paving from Copenhagen, Denmark
2: Prefer 2 12 or slower
3: I don’t play computers!
4: I usually autoflag and don’t permit takebacks
5: I don’t request takebacks either!
6: formula time >= 2 & inc >= 12

But typically, I just type finger to review my own stats. Not because I am narcissistic, but because some games or tournaments will only allow you to play if you meet the rating criteria.

  • say

I use this command during a game to “chat” with my opponent. It’s a pretty easy command to use, like so:

say hi!

  • seek

This is the command I use alot when I want to play a game. I usually use this:

seek 15 0 rated

To offer a game of 15 minutes, with no added time per move (increment) and that the game will be rated. Now anyone can click on my game and play against me.

Well, those are the commands that I use the most. In particular, the mailstored command is really handy to store your games offline. Hope you found that interesting, and be sure to look me up on FICS sometime for a game!

Linux – keep it simple.


CompTIA stackable certifications!

CompTIA has come out with a new way to “stack” certifications together. Now you can combine certificates that are current to make several different “stackable” badges. I think the overall idea is to have a single badge to take the place of two or three certifications to simplify conveying your competency.

Previously, while working in the IT industry, you would have to say something like, “I am certified Net+ and Linux+”. But now you can just say that you hold a CLNP instead. At least, that seems to be the goal.

I’m not sure if it is really useful or not, as they invented nearly a dozen stackable certifications, there are about as many combinations as there are certifications.

It does sound cooler though! It kind of reminds me of power ups in old video games (maybe new games too, I just haven’t played many recently). Sort of like in Heavy Barrel, if you get enough pieces, then you can have the super gun!

Makes me wonder what’s at the top of the stackable chain?

Linux – keep it simple.

Fool’s Mate Friday: Jin, FICS, and Correspondence Chess

Apparently, the earliest documented correspondence chess game was played between Henry I of England and Louis VI of France, but the earliest correspondence chess game in which all of the moves were recorded took place sometime in 1804 between F. W. de Mauvillion of Breda and an officer at a city of Holland, The Hague. According to Harry Golombek in his book ”Golombek’s Encyclopedia of Chess”.

Since then, we’ve moved to more modern methods of distance play, especially since the Internet. Now you can play on your computer, your cell phone, via email, or even telephone.

That brings us to Jin, but not rummy. That’s right, I’m talking about Jin, the chess interface. Here’s what the author of this great program says about it:

Jin is an open source, cross platform, graphical client for chess servers, written in Java. Jin can run either as a standalone application (available at this website) or as an applet, directly from your browser (available at the chess server’s website).

I’ve been using Jin for quite a while now on my Linux based machine. Among the many great things about Jin is that it is open source and cross platform. There is not enough of these kinds of good programs going around.

One of the best features, of course, is the ability to hook up to several chess servers, including FICS, the Free Internet Chess Server. I play there regularly myself. Of course, I am a big fan of free, so the price is right, but I also like the ability you have to message other players (somewhat like email), chat with your opponent during the game, keep a journal of your past games, and even email your played games to yourself. Perhaps later I can do an article specific to FICS and some of the great features there.

For now, you are probably wondering if this has anything to do with my Just Chess Engine. Well, I hope to one day have it playable on chess servers (although I doubt it would garner a great score), but it is not there yet. It is, however, available for others to drag and drop into their Android or Java applications to be used as a weak starter engine. No, I want to focus today on correspondence.

My next goal with my chess programming is to stick with Android for now, and in particular, cell phones. I’d like to build an android app that allows you to play other people who are not in the same room. I plan to venture into several different methods of communication, which will help me learn a lot about programming. In all of these methods, I hope to make a playable chess app as the objective.

My plan thus far is to make an app that starts with the option to play against the Just Chess engine, as a single player game. Then, I hope to move to a local, player verses player game, and for kicks, I’d like to progress to a game in which two players may play remotely, with the moves being sent via text, and the game app automatically importing those text moves into play.

From there, who knows? If the text games work well, I may branch out to how to have multiple games going at once, distinguished via some tag in the text messages. Or perhaps I’ll try my hand at a Bluetooth chess app. I’m not really sure. Either way, I have some work ahead of me, and hope you enjoy following along with my journey.

Linux – keep it simple.


Getting permission to program the Bluefruit Feather board in Ubuntu

bf_f_1st program

I am learning more every day by simply trying to play with my new toy: a Bluefruit Feather board! As I mentioned before, my brother got this little gadget for me as a Christmas present, and it has been a lot of fun to play with!

I was having a bit of trouble uploading my program to it, though, until I figured out my problem. Since this took me a while, I thought I would share it with you, so perhaps you can save a little bit of time on this issue.

TL,DR: Make sure you add your username to the dialout group, so you will have permission to use the ttyUSB0 interface.

I was attempting to upload a little program (the default beginner program, slightly tweaked to change the blink time) to the board. I had the drivers installed, I could hook to the board and pull the boards data, but I couldn’t upload the new program to it.

I kept getting an error that suggested I needed to put the device in DFU mode, but that didn’t turn out to help me. The issue was simply one of permission. My username did not have permission to use the ttyUSB0 interface. So, usermod myself into the dialout group, and after logging out and back in, I was good to go!

Here is the little program that I uploaded to the board:

void setup() {

void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(5000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second

It just causes the red led to flash for 5 seconds, turn off for 1 second, and repeat endlessly. It worked great! But, that wasn’t cool enough…. So I looked over some examples and made it fade in and out with this code:


int brightness = 0; // how bright the LED is
int fadeAmount = 5; // how many points to fade the LED by

void setup() {

void loop() {
analogWrite(LED_BUILTIN, brightness);

// change the brightness for next time through the loop:
brightness = brightness + fadeAmount;

// reverse the direction of the fading at the ends of the fade:
if (brightness <= 0 || brightness >= 255) {
fadeAmount = -fadeAmount;
// wait for 30 milliseconds to see the dimming effect

Now I have my own mini Cylon with a glowing, fading red eye saying, “By your command!” (Okay, so I may be having way too much fun with this….)

Linux – keep it simple.


Fool’s Mate Friday: Touching up the User Interface….


My uncle once told me that a good paint job will sell a bad airplane. He’s right. As an airplane mechanic, he knew the value of the planes that he worked on. At the same time, he saw customer after customer get “swindled” on a plane that looks nice on the outside.

The thing is, it’s true for apps and games as well. A really good program that doesn’t look good just isn’t as fun. Truth is, this engine app needed a little touch up in the gui department. So, while I didn’t make it pretty, I did add features to try to make it more useful.

Similar to the Beginning Chess Engine, I added a commit to allow the user to make a move by pressing the button. Simple stuff really, but up ’till now, I was doing all of my move making from the command line through the app code itself. Of course, if you can make a move, you need to be able to take it back to, so I added a commit to give the undo move method.

The flow of these move methods are pretty simple. For most moves, it checks the from space and the to space and puts an “*” (asterisk) at the from, and puts the piece that was there in the to space. The process is reversed for the undo move method.

There are a few exceptions, though, like the additional moves that are special, en passant, castle, and promotion. Those are handled by reading the input move first to see if it matches any of those scenarios, if not, then a regular move is performed.

Obviously, making moves in chess is a pretty important part of the game. The longest chess game theoretically possible is 5,949 moves, and that would be impossible to do if you couldn’t actually make any of those moves!

Linux – keep it simple.


Setting up the Arduino-IDE for the Bluefruit Feather in Ubuntu


There are a lot of neat tools available to program/hack/reprogram/work with this nifty little Bluefruit Feather board! One of them is the Arduino-IDE, a development environment that allows you create and then flash your new programs to the board. I was faithfully following along in the Bluefruit Feather Arduino setup instructions, which are here:

But I ran into an issue right out of the gate with step #1: Install the Arduino-IDE. In the instructions it states that it must be version 1.6.12+, something that I missed the first go around. Using Ubuntu’s regular package manager, I just used apt-get install to download  and install the Arduino-IDE.

When I moved on to the next step, where you are to put in the “Additional Board Manager URL”, I ran into a snag. There was no place to do that. The block that should have been displayed there in the preferences didn’t exist. So I re-read the instructions. Turns out that the Ubuntu repository only has Arduino-IDE version 1.0.5! So it was a little out of date.

Fortunately, on the bsp setup page above, there was a direct link to download and install the newer version of the software. A quick download, unzip/untar, and a quick $ sh ./ command allowed me to install the latest version in minutes. Hopefully you can avoid that same pitfall. Now, back to those instructions….

Linux – keep it simple.


Fool’s Mate Friday: Keeping the king safe!


The word “Checkmate” in Chess comes from the Persian phrase “Shah Mat,” which means “the King is dead.”

While in the starting position, there are eight different ways to checkmate in two moves and 355 different ways to checkmate in three moves. Not to mention the countless other ways to be checkmated. Kind of sounds like one of those television series of “1000 terrible ways to die.”

We’ve looked before at code for making the king move, but now we want to break down how we check if the king is safe. Here’s the kingSafe commit, and we can reference several things from that code as we try to understand what I set out to accomplish.

First, let’s take a look back at the flow chart for determining available moves:

  • For each piece, check for valid moves that they can make, where the spaces are empty, or where they attack an opponent’s piece.
  • Add that move to the temporary list.
  • Once we have a temporary list of valid moves, try each move, 1 at a time, and check if the king is safe.
  • If the king is safe, add that move to the “available moves” list.
  • Put the piece back, and try the other moves on the temporary list.

With that in mind, up until now, our engine has not actually checked if the king is safe. We had a isKingSafe() method that always returned true, or “yes, he is”. Now we need to flesh that out and have it really check if it is safe. For the most part, we can combine all the pieces move options into one for the king, and just ask what pieces are at the “end” of those move lines. Here’s the flow chart:

  • Start with the king’s space number, and get the row/column number as well.
  • Using the bishop’s move table, check the next diagonal space until it is not empty. If it is not empty, is it either a bishop or a queen? Then the king is not safe.
  • Using the rook’s move table, check the up/down/left/right spaces until they are not empty. If it is not empty, is it either a rook or a queen? Then the king is not safe.
  • Using the knight’s move table, check the eight “L” spaces to see if they are empty. If it is not empty, is it either a knight? Then the king is not safe.
  • Using the king’s move table, check the surrounding spaces until it is not empty. If it is not empty, is it a king? Or in two cases, a pawn? Then the king is not safe.
  • The king must be safe!

As you can see from the flow chart, it is checking to see if the king is “not safe”. At any juncture that the king is not safe, the rest of the checks are ignored, and a “false” boolean is returned from the isKingSafe0 method. If there are no returns of “false”, then the method returns “true”, for the king must be safe.

In my mind, there are three main ways to handle the king safe issue:

  1. After each piece is moved, have it flag that the king is unsafe (e.g., you check the king, so he is unsafe).
  2. After every move, check from all pieces to see if they are attacking the king.
  3. After every move, check from the king if he is threatened by any pieces.

Method one seems hard to implement, when moving you own piece may illegally threaten the king by no longer “blocking” an attacker. Conversely, method two is way more resource intensive. You would waste time checking both bishops in all directions to see if they “find” the king. Method three seems the most logical, check from the king in all directions for the enemy, rather than from all enemies for the king.

Of the method we chose, there seem to me to be two sub-methods, that of checking if the king is safe, or checking if the king is not. I like to assume the king is safe, unless we find that he is not. I think this is faster, because the moment we find he is not safe, then we quit checking. E.g., if the bishop check reveals the king is not safe, we don’t do the rook, king, knight, pawn checks, we just return “false” – not safe.

Conversely, if we were to assume the king is not safe, and prove he is, we would have to complete all of the checks every time. This would be a waste of resources. Although, with the method I chose, most of the time, the king is safe, so we end up checking them all anyways. But, since we are trying to use this engine on cell phones, we need to save on every resource that we can.

Linux – keep it simple.


Building a photon cannon tower….

Well, at least building one graphically! I was working with the Quiet Learner on his new tile tower defense game. He’s only in a pre-alpha stage right now, so there isn’t anything playable as of yet. If you are interested, you can check out his work here:

He is doing all of the coding for his game, and my participation is rather small. He was looking for a little bit of artwork for the towers and enemies, so I took some time to draw some old school pixel artwork in Gimp.


Thinking that it may be useful for others as well, I’ve put together a repository with my small collection. It is licensed under the CC0, so it is readily available for any other games, icons, or uses, too. Be sure to check it out, and if you end up using it yourself, be sure to drop a comment here so I can check out your great game!

Linux – keep it simple.


Fool’s Mate Friday: Perilous times for pawns!


Did you know that the piece with the lowest survival rate is the white queen’s pawn at d2? That’s right, out of 2.2 million master level games, this pawn survives the least games at only 24.5%. Conversely, king not withstanding, the one piece with the highest survival rate of any of those games is the white king’s rook’s pawn at h2? It survives over 73% of games played! With such a wild spectrum, this small piece is actually the highest and lowest survivor of any chess game. You can check out all of the stats for piece survival here at Oliver’s blog.

Of special interest, Oliver also wrote a program to analyse all of the moves to find that information, which you can look at on GitHub.

Personally, I find the pawn to be the most important piece of the game. But that is for another time. For now, we need to make some pawn moves. Surprisingly, for such a simple piece, it has the most complicated moves:

  1. Pawns can move forward one space.
  2. Pawns can move forward two spaces from the “home” row.
  3. Pawns can attack diagonally forward.
  4. Pawns can perform en passant only under the right conditions.
  5. Pawns can promote to another piece.

I am sure that you realized those moves exist, but by seeing them put to paper we can really get the feel for how complicated making the pawn move is! Of all of those moves, 4 of the 5 are conditional, meaning they can only be done under certain conditions. This makes programming them tough, as you have to check if those conditions exist, then check if making the move is possible, then check if that move is safe for the king.

As you can see in my pawn commit, I added the pawn moves, but there are some flaws in them. Unfortunately, most of these flaws were not realized at the time, but were fixed later, here and here. Essentially, the move that was flawed is en passant, both in the making and the undoing of that move. However, I did not realize it at this point, until I started making the engine perform and undo moves.

So, take a look at the code, and feel free to comment if you think of a better way to do those moves.

Linux – keep it simple.


Having trouble building Bluefruit LE app in Android Studio?

While playing with my Bluefruit Feather, I decided to build the Android app straight from the source code, so I could see the ins and outs of how it works. Unfortunately, when I downloaded the source code and loaded it into Android Studio, I noticed that it didn’t compile the gradle files correctly.

Turns out that they updated the gradle files for Android Studio 3. My Linux distribution was still using Android Studio 2.3.3. That may see pretty out of date, but it went from 2.3 straight to 3.0.

So, I had two choices, update my Android Studio manually, or downgrade the Bluefruit LE app. Fortunately, Github allows you to view a repository at a previous commit level. So, I loaded up the commit just before they updated the gradle files, and downloaded the repository at that state. I figured if you are reading this, you might want that too, so here is a direct link:


Downloaded, unzipped, loaded with Android Studio 2.3.3, and ta-da! It worked! I like easy problems. In the future, however, I will need to update my Android Studio anyways, but for now, this gets me where I need to be. Perhaps by the time I need to update, the Linux version I am using will have that package available pre-built.

Linux – keep it simple.