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
  • Other

Category: Algorithms

Bowling Regex

Posted on February 1, 2025April 7, 2025 By William Jojo
Algorithms

(Updated April 7, 2025) 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, 2024July 26, 2024 By William Jojo
Algorithms

(Updated July 26, 2024) 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 … Read More “Building a Guessing Game” »

Converting Strings

Posted on February 12, 2024January 31, 2025 By William Jojo
Algorithms

(Updated November 19, 2024) 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, 2023January 20, 2025 By William Jojo
Algorithms

(Updated December 18, 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 some experience, you can see the binary tucked inside, as each hex digit represents … Read More “The Hex Dump” »

Short-Circuit Evaluation – Advanced Example

Posted on December 28, 2012November 19, 2024 By William Jojo
Algorithms

(Updated November 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” »

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

Copyright © 2018 – 2025 Programming by Design.