Take Your Turn

The game of Tic-Tac-Toe, also called Noughts and Crosses, provides a fertile field to plow for any budding programmer. It involves a matrix (array), logic, decisions, and all sorts of fun. If you haven’t yet coded your own Tic-Tac-Toe game, I urge you to do so, but that’s not the topic for this month’s Exercise.
Continue reading

Flipping a Byte

One of the first programming puzzles I solved on my own was a byte flip. That’s the process for taking a binary value and flipping it: You transpose bits 0 through 7 to bits 7 through 0. This is a puzzle that comes up frequently in programming, but one for which no single solution is preferred.
Continue reading

Your Card is Valid

When you type a credit card number on a website, or scan the card into a physical device, a quick calculation is performed to ensure that the card number is valid. This check happens before the bank is contacted to verify the account and the amount. The technique used to perform the quick calculation is known as the MOD 10 algorithm.
Continue reading