Browse category PHP Puzzles

PHP Puzzles: Maze Rats, Part Three

by · June 24, 2023

0
 

In the prior two installments, we’ve explored maze-generating algorithms. Once you’re in the labyrinth, you’ll want a way to find the exit. In this final installment, we figure out how to get from the maze’s entrance to the exit. by Oscar Merida

 

PHP Puzzles: Maze Rats, Part Two

by · May 31, 2023

0
 

Last month, we solved how to represent a maze by storing the configuration of walls for each grid square within. Now, we’ve been tasked with generating a solvable maze at random. by Oscar Merida

 

PHP Puzzles: Maze Rats

by · April 20, 2023

0
 

Back in the January 2021 installment for PHP Puzzles, Sherri Wheeler looked at drawing a path through a grid. In this first part, we delve into the work of maze generation. by Oscar Merida

 

PHP Puzzles: Grade Deviations

by · March 24, 2023

0
 

We’re continuing with grades and statistics by calculating statistics for Grade Point Averages. In the educational system in the United States, it’s a way to boil down the grades across the multiple courses taken by a student. It involves translating a letter grade back to a numeric value and then calculating a weighted average. At […]

 

PHP Puzzles: Stats 101 Grade Book

by · February 10, 2023

0
 

Let’s go back to basics and look at some different ways to measure the average value in a list of numbers. More specifically, they’re ways of measuring central tendency. These handy techniques to identify “the middle” of a set prove useful when analyzing sales, traffic, or other frequency counts. by Oscar Merida

 

PHP Puzzles: Any Two Birthdays

by · January 16, 2023

0
 

Working with dates and times is fraught with peril, so it helps to practice manipulating such data. We’ll have to be wary of how to calculate differences between dates, potentially deal with leap days, and other irregularities. by Oscar Merida

 

PHP Puzzles: Sticker Swapping

by · December 15, 2022

0
 

The FIFA World Cup wraps up this month. One thing many fans worldwide do in the months leading up to the tournament is to fill out sticker albums with each team’s roster. Completing an album, short of spending a ton of excess money, involves trading with other collectors. A common technical interview question is to […]

 

PHP Puzzles: World Cup Draws

by · November 11, 2022

0
 

A random draw is straightforward, but we usually have business rules to implement and consider in any solution. With the World Cup kicking off this month, we get a chance to look at one scenario. Can you draw the teams into proper groups before the tournament starts? by Oscar Merida

 

PHP Puzzles: Converting Float Strings

by · October 8, 2022

0
 

Converting data is never as straightforward as we’d initially expect. Users can enter data incorrectly or in the wrong format. On the other hand, computers may not have trouble working with some data. For this article, we look again at floating-point values. by Oscar Merida

 

PHP Puzzles: Fractional Math

by · September 9, 2022

0
 

We’ve seen how working with floating-point values can be problematic. What if we had a class that worked with fractions directly by tracking the numerator and denominator as integers? Let’s see if it’s possible. by Oscar Merida