Is this new? It's the pennies algorithm: to roll a d6, flip five pennies, count heads and add 1. I was doing this back in the '90's in Turbo C and (with a zener noise source) 8051 assembly.
to roll a d6, flip five pennies, count heads and add 1
Fail. It is a good thing you didn't write the actual code since it would be wrong. You're in luck, click on the link provided above and Learn.