Implementation of Perl's Algorithm::CouponCode for Ruby