
Have a road trip planned this summer? Want to keep the kids from driving you crazy as you drive to Walley World? How about playing the ol’ standard License Plate game but with a twist: License Plate Bingo!
Run this code a couple of times and print out the chart on separate pieces of paper. There are your bingo cards. Give one to each kid and/or adult. Now, hit the road! If you see a license plate from, say, Texas, and you have a “Texas” square, mark it off on your bingo card. If you can mark off a row horizontally, vertically, or diagonally, you win!
Step 1: Import your packages
1 2 3 4 5 6 7 | import matplotlib.pyplot as plt import matplotlib.style as style import numpy as np import random % matplotlib inline style.use( 'seaborn-poster' ) |
Step 2: Get your State names
1 2 3 4 5 6 7 8 9 10 11 12 13 | # compliments of this forum: https://gist.github.com/JeffPaine/3083347 states = [ "AL - Alabama" , "AK - Alaska" , "AZ - Arizona" , "AR - Arkansas" , "CA - California" , "CO - Colorado" , "CT - Connecticut" , "DC - Washington DC" , "DE - Deleware" , "FL - Florida" , "GA - Georgia" , "HI - Hawaii" , "ID - Idaho" , "IL - Illinios" , "IN - Indiana" , "IA - Iowa" , "KS - Kansas" , "KY - Kentucky" , "LA - Louisiana" , "ME - Maine" , "MD - Maryland" , "MA - Massachusetts" , "MI - Michigan" , "MN - Minnesota" , "MS - Mississippi" , "MO - Missouri" , "MT - Montana" , "NE - Nebraska" , "NV - Nevada" , "NH - New Hampshire" , "NJ - New Jersey" , "NM - New Mexico" , "NY - New York" , "NC - North Carolina" , "ND - North Dakota" , "OH - Ohio" , "OK - Oklahoma" , "OR - Oregon" , "PA - Pennsylvania" , "RI - Rhode Island" , "SC - South Carolina" , "SD - South Dakota" , "TN - Tennessee" , "TX - Texas" , "UT - Utah" , "VT - Vermont" , "VA - Virgina" , "WA - Washington" , "WV - West Virginia" , "WI - Wisconsin" , "WY - Wyoming" ] state_names = [s.split( '-' )[ 1 ].strip() for s in states] |
Step 3: Generate your bingo card
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | random.shuffle(state_names) rowlen = 4 # make any size card you'd like fig = plt.figure() ax = fig.gca() ax.set_xticks(np.arange( 0 , rowlen + 1 )) ax.set_yticks(np.arange( 0 , rowlen + 1 )) plt.grid() for i, word in enumerate (state_names[:rowlen * * 2 ]): x = (i % rowlen) + 0.4 y = int (i / rowlen) + 0.5 ax.annotate(word, xy = (x, y), xytext = (x, y)) plt.show() |

Grab my full source code here.
Recent Comments