Skip to content

Instantly share code, notes, and snippets.

View patr1k's full-sized avatar

patr1k patr1k

View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
/**
* Patrik's Sudoku Solver
*
* Rather than storing cell values as normal integers, we're using bitmask
* representations of each value:
*
@patr1k
patr1k / SudokuSolver.ts
Last active August 15, 2024 16:14
Simple Sudoku Solver
/**
* Simple Sudoku Solver
*
* @description Sudoku solver implemented in TypeScript. Intended to run in Deno
* @example deno run sudoku.ts
* @author Patrik <pdeloughry@cyntacs.com>
* @license CC-BY Creative Commons Attribution
*/
// Puzzle Cell Value
@patr1k
patr1k / EnumHelper.php
Created April 30, 2018 13:51
Enumerated Value Helper for PHP
<?php
/**
* EnumHelper
*
* This is a simple, lightweight solution for enforcing enumerated domain values. Other solutions
* require instantiating a "domain class" which yields a string value via class::__toString(). My
* approach keeps the domain enforcement logic contained within a trait, which can be imported into
* your own classes, reducing the complexity and increasing the speed of your code.
*
* PHP version 7.1