Back## Programmer's way of remembering playing cardsUnless you use more abstract methods of remembering playing cards, it can be difficult to know which cards have been dealt from a pack when playing a game of cards. This method reduces the whole pack to just 13 numbers or letters. Instead of having to remember sentences such as "King of Spades, King of Clubs" you just remember a number or letter. Supposing you only want to remember Kings, Queens and Jacks then you would only have to remember 3 numbers or letters. The downside to this method is that it requires a good understanding of hexadecimal and binary and the ability to convert from one to the other quickly. The more you practise this the easier it becomes to convert the numbers, and the easier it is to visualise the binary strings in your head. The whole idea is based around a table of all the playing cards in a pack. To start with you need to order the suits in a way you will always remember. I use Spades, Clubs, Hearts, Diamonds. The table looks like this:
As cards are dealt you fill in the table with a 1 for a card that has been dealt, and you leave a 0 for a card that has yet to be dealt. Therefore in the row for the Kings you may have the following:
This can then be written as 0101 in binary. Or to make it clear it is a binary number, 0101b. As everyone knows, this is the same as 5 in hex, or 0x05 or 5h depending on whether you are a C programmer or an assembly programmer. In this explanation I'll end binary numbers in a 'b' (for binary) and end hex numbers in an 'h' (for hex). (Not that I'll do it here, but for decimal numbers I would end the number in 'd'). This is the standard assembly language notation, which seems to make more sense for this explanation. Here is a chart for converting from hex to binary for 4 bit numbers: (It is never necessary to convert to decimal numbers, and would just confuse things).
Therefore if you had had the King of Clubs and the King of Diamonds you would have the number 0101b which is also 5h. Therefore you just remember the number 5. As more Kings are dealt you fill in the zeroes in the binary number with ones. At any point you can tell from the binary number which Kings have been dealt and which are still in the pack. Technically when a new King is dealt you are "Or"ing the number with either 8, 4, 2 or 1. To start with you will need to keep converting the easily remembered hex number to binary in order to fill in another bit, and then convert it back in order to remember it. With more practice you will be able to visualise it all in your head. It can be hard to do this fast at first, but it gets a lot easier. - If you get a new Diamond you know that you only have to add 1 on. - If your hex number is 0fh then you have all that type of card. - It becomes easier to convert from hex to binary if you think of the patterns - 0ch is 1100b whilst 3h is 0011b. - If you have 7h then you know you are waiting for the Spade. - If you have 0eh then you know you are waiting for the Diamond. The easiest way to develop this method is to start by remembering just Kings, Queens and Jacks, in which case you would be remembering just three numbers/letters. That way you can concentrate on the maths rather than remembering sequences of numbers/letters. When you can do that you can concentrate on remembering long sequences of numbers/letters. Simple Example: Here we will just concentrate on Kings and Queens meaning we only have to remember two letters or numbers. All the Kings and Queens shuffled: No Kings of Spades, Clubs, Hearts or Diamonds No Queens of Spaces, Clubs, Hearts or Diamonds Our grid looks like this:
The King number is 0000 in binary which is 0 in hex, as is the Queen number, so we just remember the King number followed by the Queen number = 00. The King of Diamonds appears so we have to fill in its entry in our grid.
The King number is now 0001 in binary which is 1 in hex. The Queen number is still 0000 which is 0 in hex. Therefore we just remember the King number followed by the Queen number = 10. The King of Clubs now appears so we have to fill in its entry in the grid.
The King number is now 0101 in binary which is 5 in hex. The Queen number is still 0000 which is 0 in hex. Therefore we just remember the King number followed by the Queen number = 50. Now the King of Spades.
The King number is now 1101 in binary which is 'd' in hex. The Queen number is still 0000 which is 0 in hex. The number we have to remember is 'd0'. Now the Queen of Clubs.
The King number is still 1101 in binary or 'd' in hex. The Queen number is now 0100 which is 4 in hex. The number we have to remember is 'd4'. Now the Queen of Diamonds.
The King number is still 1101 in binary or 'd' in hex. The Queen number is now 0101 which is 5 in hex. The number we have to remember is 'd5'. Now the King of Hearts.
The King number is now 1111 in binary meaning we have all the Kings. This is 'f' in hex. The Queen number is still 0101 or 5 in hex. The number we have to remember now is 'f5'. Now we can make the best use of this method of remembering cards - we know what cards have been dealt and we can work out what cards are left in the pack, by just seeing where the 0's are in the table. We have all the Kings as we can tell by the 'King number' being 'f' or 1111. The 'Queen number' is 5 which is 0101 in binary meaning we have still to expect the Spade and the Heart. Turning over the last two cards we see we were right: If you have an entire pack of cards and remember all the Kings, Queens and Jacks as you go through it then you can almost impress people by saying which of these are left in the pack at any one point. The more rows you can add to the table in your head the more impressive it is. People generally assume you are performing a trick, but would be more impressed if they knew what you were really doing. I don't know enough about card games to know how useful it is to remember an entire pack, or a large proportion of it, but there you go. Back Contact |