import randomtimepygamesyscopy from pygame locals import fps frames per second to update the screen windowwidth width of the program' windowin pixels windowheight height in pixels boardwidth how many columns in the board boardheight how many rows in the board gemimagesize width height of each space in pixels numgemimages is the number of gem types you will need png image files named gem pnggem pngetc up to gem( - png numgemimages assert numgemimages > game needs at least types of gems to work nummatchsounds is the number of different sounds to choose from when match is made the wav files are named match wavmatch wavetc nummatchsounds moverate to larger num means faster animations deductspeed reduces score by point every deductspeed seconds purple ( lightblue ( blue red ( black brown highlightcolor purple color of the selected gem' border bgcolor lightblue background color on the screen gridcolor blue color of the game board gameovercolor red color of the "game overtext gameoverbgcolor black background color of the "game overtext scorecolor brown color of the text for the player' score the amount of space to the sides of the board to the edge of the window is used several timesso calculate it once here and store in variables xmargin int((windowwidth gemimagesize boardwidth ymargin int((windowheight gemimagesize boardheight constants for direction values up 'up down 'down left 'leftemail questions to the authoral@inventwithpython com