R
Ruby Quiz
The three rules of Ruby Quiz:
1. Please do not post any solutions or spoiler discussion for this quiz until
48 hours have passed from the time on this message.
2. Support Ruby Quiz by submitting ideas as often as you can:
http://www.rubyquiz.com/
3. Enjoy!
Suggestion: A [QUIZ] in the subject of emails about the problem helps everyone
on Ruby Talk follow the discussion. Please reply to the original quiz message,
if you can.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
by Brian Candler
A version of Bingo played in the UK and some other countries is called "Housie".
Players buy "books" of 6 tickets. Each ticket shows exactly 15 numbers, and in
each book every number from 1 to 90 is used exactly once.
A ticket is a grid of 3 rows by 9 columns. The first column contains numbers
from 1 to 9; the second column numbers from 10 to 19; the third 20 to 29 and so
on up until the last column, which contains numbers from 80 to 90.
Each column contains one, two or three numbers, in increasing order downwards.
Each row contains exactly 5 numbers (and hence 4 blanks).
An example ticket looks like this:
+----+----+----+----+----+----+----+----+----+
| 5 | | | | 49 | | 63 | 75 | 80 |
+----+----+----+----+----+----+----+----+----+
| | | 28 | 34 | | 52 | 66 | 77 | |
+----+----+----+----+----+----+----+----+----+
| 6 | 11 | | | | 59 | 69 | | 82 |
+----+----+----+----+----+----+----+----+----+
There are two levels of quiz difficulty to choose from. Given the above rules
for the validity of tickets and books, then:
1. Write a Ruby program which generates random individual tickets
or
2. Write a Ruby program which generates random complete books of tickets
1. Please do not post any solutions or spoiler discussion for this quiz until
48 hours have passed from the time on this message.
2. Support Ruby Quiz by submitting ideas as often as you can:
http://www.rubyquiz.com/
3. Enjoy!
Suggestion: A [QUIZ] in the subject of emails about the problem helps everyone
on Ruby Talk follow the discussion. Please reply to the original quiz message,
if you can.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
by Brian Candler
A version of Bingo played in the UK and some other countries is called "Housie".
Players buy "books" of 6 tickets. Each ticket shows exactly 15 numbers, and in
each book every number from 1 to 90 is used exactly once.
A ticket is a grid of 3 rows by 9 columns. The first column contains numbers
from 1 to 9; the second column numbers from 10 to 19; the third 20 to 29 and so
on up until the last column, which contains numbers from 80 to 90.
Each column contains one, two or three numbers, in increasing order downwards.
Each row contains exactly 5 numbers (and hence 4 blanks).
An example ticket looks like this:
+----+----+----+----+----+----+----+----+----+
| 5 | | | | 49 | | 63 | 75 | 80 |
+----+----+----+----+----+----+----+----+----+
| | | 28 | 34 | | 52 | 66 | 77 | |
+----+----+----+----+----+----+----+----+----+
| 6 | 11 | | | | 59 | 69 | | 82 |
+----+----+----+----+----+----+----+----+----+
There are two levels of quiz difficulty to choose from. Given the above rules
for the validity of tickets and books, then:
1. Write a Ruby program which generates random individual tickets
or
2. Write a Ruby program which generates random complete books of tickets