Skip to content

Programming by Design

If you're not prepared to be wrong, you'll never come up with anything original. – Sir Ken Robinson

  • About
  • Java-PbD
  • C-PbD
  • ASM-PbD
  • Algorithms
  • More!
    • Commodore 64
    • Operating Systems
    • Odds and Ends
    • Theory

Category: Algorithms

Bowling Regex

Posted on February 1, 2025October 28, 2026 By William Jojo
Algorithms

(Updated October 28, 2026) Table of Contents Overview The First Regex The Better Regex – Part I The Better Regex – Part II Conclusion Overview Overview As we build the program to score and print a series of marks representing a complete game, we should also consider how to measure whether the scoring is legitimate. … Read More “Bowling Regex” »

Building a Guessing Game

Posted on February 14, 2024November 4, 2026 By William Jojo
Algorithms

(Updated November 4, 2026) 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 to craft the building blocks of a valuable, user-friendly game. User Input The … Read More “Building a Guessing Game” »

Converting Strings

Posted on February 12, 2024October 29, 2026 By William Jojo
Algorithms

(Updated October 29, 2026) 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 … Read More “Converting Strings” »

The Hex Dump

Posted on September 10, 2023October 30, 2026 By William Jojo
Algorithms

(Updated October 30, 2026) Overview Hex dumps have been around for a very long time. Looking at binary is mind-numbing, and decimal is less than ideal. Hexadecimal makes values much easier on the eyes. With some experience, you can see the binary tucked inside, as each hex digit represents four binary digits. The question is … Read More “The Hex Dump” »

Short-Circuit Evaluation – Advanced Example

Posted on December 28, 2012November 3, 2026 By William Jojo
Algorithms

(Updated November 3, 2026) 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 is established, the evaluation will … Read More “Short-Circuit Evaluation – Advanced Example” »

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Copyright © 2018 – 2026 Programming by Design.