Browse category PHP Puzzles

PHP Puzzles: Staircase Path

by · January 8, 2021

0
 

Welcome to a new year! In our last puzzle, we started building a collection of related functions to output and navigate through a grid, starting with printing our grid to a command-line using dark and light shade characters to indicate wall or open path, respectively. In this article, we look at plotting a route from […]

 

PHP Puzzles: Grid Mapping

by · December 3, 2020

0
 

In our last issue, we plotted a list of compass directions onto a grid to determine a destination x,y point. In this article, we look at generating a simple output for a colored grid.

 

PHP Puzzles: Destination Point

by · November 11, 2020

0
 

In our last issue, pruned a set of directions to remove values that cancel each other out. It was an exercise in cleaning data, an often crucial step before importing it or processing it elsewhere. In this article, we look at plotting those directions on a grid.

 

PHP Puzzles: Improved Directions

by · October 5, 2020

0
 

In our last issue, we simulated population growth—a component of many popular games. In this article, we look at pruning redundant items from a list of directions.

 

PHP Puzzles: Writing a Dice Roller

by · August 6, 2020

0
 

In our last issue, we looked at a problem from game development—generating random loot with different rarities. We saw multiple solutions, including a common technique used in many games. Our new puzzle asked us to calculate dice rolls for tabletop games.

 

PHP Puzzles: Random Loot

by · July 1, 2020

0
 

In our last issue, we looked at multiple solutions for the Fibonacci math problem. We saw a common recursion gotcha when one of our solutions caused PHP to timeout on modest inputs. We then took a more fun direction and presented a problem from game development: randomizing the quality of loot generation. Let’s look at […]