gemgema "bejeweledclone --bejeweled|is game where gems fall to fill up board the player can swap any two adjacent gems to try to match three gems in row (vertically or horizontallybut not diagonallythe matched gems then disappearmaking way for new gems to fall from the top matching more than three gemsor causing chain reaction of gem matches will result in more points the player' score slowly drops over timeso the player must constantly be making new matches the game ends when no possible match can be made on the board source code for gemgem this source code can be downloaded from the image files that flippy uses can be downloaded from gemgem ( bejeweled clone by al sweigart al@inventwithpython com released under "simplified bsdlicense "" this program has "gem data structures"which are basically dictionaries with the following keys 'xand 'ythe location of the gem on the board , is the top left there is also rowaboveboard row that 'ycan be set to to indicate that it is above the board 'directionone of the four constant variables updownleftright this is the direction the gem is moving 'imagenumthe integer index into gemimages to denote which image this gem uses ""