photo of Cosimo Streppone

Random hacking

Assume nothing. Code defensively. Keep it simple, stupid!

Have you ever heard "Bon Digi"?

, , , , , , ,

It's a game. A crazy one. A really crazy one.
We were doing it friday evening, drinking like nuts, and something in my mind popped up, and I thought:

We should code the algorithm for this game

In fact, it seemed really stupid and obvious. But thinking about it more and more, I discovered that it's not so simple at all...

And if you want to code it elegantly and concisely, you have to think about it for some time.
So, I took this -Ofun opportunity, and turned it, as I promised to Zoso, into a Games::BonDigi CPAN module.

Enjoy!

This guy is a geniousBonDigi is the programming game of the moment

Comments

Anonymous Sunday, May 16, 2010 12:00:19 PM

polettix writes: Ciao Cosimo, I tried to solve the game without looking at your solution first, does it pass your definition of "elegant and concise"? You can find it at http://polettix.it/trivia/bondigi.pl I wonder how many of you at the table chose to do a mistake just for drinking!

Cosimo Strepponecstrep Sunday, May 16, 2010 12:25:33 PM

Ciao Flavio,

your solution is similar to my last one that I published on CPAN. I wanted to do something with iterators, so yes, yours it's even more iterator-ish than mine smile

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies