Overview When building a simple text game, we want the process to be smooth and elegant. There should be few places to trip up the user or make the play awkward. In this write-up, we look at how we can craft the building blocks of a valuable and user-friendly game. User Input The hardest part … Read More “Building a Guessing Game” »
Category: Algorithms
Overview We often have data in a form that is not immediately useful. If we need to do mathematical calculations and all we have is a string, we must first take another step. Here, we explore some of the finer details of how this can be done by examining the algorithm to convert from String … Read More “Converting Strings” »
(Updated February 21, 2024) Overview Hex dumps have been around for a very long time. Looking at binary is mind-numbing, and looking at decimal numbers is less than ideal. Using hexadecimal to show values is much easier on the eyes. With a little experience, you can see the binary tucked inside, as each hex digit … Read More “The Hex Dump” »
(Updated February 19, 2024) Short-Circuit Evaluation – Advanced Example The Problem As we know, with the conditional operators && (and) and || (or), we can join multiple Boolean expressions together to form a more complex expression. You may also recall that these operators operate in a mode known as short-circuit. This means that once truth … Read More “Short-Circuit Evaluation – Advanced Example” »