Matthew Ellen .co .uk

Useful code snippets

StrToCol

A function to convert the first 3 characters of a string to an HTML colour (but without the #) by using the characters' hexadecimal ASCII values.

Languages: PHP, Delphi


IntToTri

A function for converting unsigned integers into trinary numbers. Returns a string. Courtesey of David Woo.

Languages: C++


lcm

A function that calculates the least common multiple of a list of numbers

Languages: Haskell, C#