Number words

Today’s five minute post brought to you via Programming Praxis / Career Cup:

Given a positive integer, return all the ways that the integer can be represented by letters using the mapping 1 -> A, 2 -> B, …, 26 -> Z. For instance, the number 1234 can be represented by the words ABCD, AWD and LCD.

read more...


Cracker Barrel Peg Game, Part 2

Hey, remember that post a few days ago about the Cracker Barrel peg game? Right at the end, I mentioned that there would be a part two, all about how to bend the puzzle at least a bit to your advantage. Basically, rather than finding the first solution to the peg game, we’re going to find all of them. From there, we can determine which moves are easier to win from, which are harder, and which are downright impossible. Let’s do it!

read more...


Call stack bracket matcher

Five minute post from Programming Praxis:

Write a function to return true/false after looking at a string. Examples of strings that pass:

{}, [], (), a(b)c, abc[d], a(b)c{d[e]}

Examples of strings that don’t pass:

{], (], a(b]c, abc[d}, a(b)c{d[e}]

read more...


What the (be)funge‽

Here’s a fun little bit of code for you:

55*4*v    _   v
v   <>:1-:^
    |:<$      <    ,*48 <
    @>0"zzif">:#,_$      v
>:3%!|    >0"zzub">:#,_$^
     >:5%!|
v "buzz"0<>:.           ^
         |!%5:           <
>:#,_   $>              ^

Gibberish you say? No! Befuge!

read more...