bingo.inBingo is a popular game played on a 5 by 5 grid, called a card. Each square on the grid has a number in it. As numbers are selected, they are marked off the card. When a line of five squares, horizontal, vertical or diagonal, is marked out, the card is a winner. A sample bingo card is below:
| 12 | 28 | 31 | 49 | 66 |
| 3 | 26 | 45 | 53 | 75 |
| 10 | 17 | 33 | 59 | 67 |
| 7 | 19 | 42 | 55 | 74 |
| 2 | 23 | 37 | 46 | 70 |
If the numbers 3, 45, 53, 75, and 26 are picked, then there will be a horizontal bingo on the second row.
Write a program to play a game of bingo.
The input to your program will be a list of 1 to 20 bingo cards. The first value in the set will tell how many cards are to be played. For each card, there will be a list of 25 numbers, in row major order. Each number will be in the range 1 to 75. After the numbers for the cards will be a random ordering of the numbers from 1 to 75.
As soon as one of the cards has a bingo, write the number of the card that has a winner and tell if the five squares in a row are horizontal, vertical, or diagonal.
2 12 28 31 49 66 3 26 45 53 75 10 17 33 59 67 7 19 42 55 74 2 23 37 46 70 1 16 31 46 61 2 17 32 47 62 3 18 33 48 63 4 19 34 49 64 15 30 45 60 75 66 67 23 69 68 70 46 47 48 49 50 1 2 3 4 5 11 12 13 14 15 36 37 38 39 40 21 22 24 25 71 73 72 74 75 16 17 18 19 20 26 27 28 29 30 31 32 33 34 35 41 42 43 44 45 6 7 8 9 10 51 52 53 54 55 56 57 58 59 60 61 62 63 65 64
Card 2 wins with a vertical bingo!