file " :\book svn\src\memorypuzzle py"line in main(file " :\book svn\src\memorypuzzle py"line in main mainboard getrandomizedboard(file " :\book svn\src\memorypuzzle py"line in getrandomizedboard columns append(icons[ ]indexerrorlist index out of range we could spend lot of time looking at getrandomizedboard(trying to figure out what' wrong with it before realizing that getrandomizedboard(is perfectly finethe real source of the bug was on line and where we set the boardwidth and boardheight constants the assertion makes sure that this never happens if our code is going to crashwe want it to crash as soon as it detects something is terribly wrongbecause otherwise the bug may not become apparent until much later in the program crash earlyyou want to add assert statements whenever there is some condition in your program that must alwaysalwaysalways be true crash oftenyou don' have to go overboard and put assert statements everywherebut crashing often with asserts goes long way in detecting the true source of bug crash early and crash often(in your code that is notsaywhen riding pony making the source code look pretty gray ( navyblue white ( red ( green blue yellow ( orange ( purple ( cyan bgcolor navyblue lightbgcolor gray boxcolor white highlightcolor blue remember that colors in pygame are represented by tuple of three integers from to these three integers represent the amount of redgreenand blue in the color which is why these