lines to do almost the same thing as lines to do except for moving the falling piece down this has separate move variable (movingdownand --last time|variable (lastmovedowntimeas well as different --move frequency|variable (movedownfreqletting the piece "naturallyfall let the piece fall if it is time to fall if time time(lastfalltime fallfreqsee if the piece has landed if not isvalidposition(boardfallingpieceadjy= )falling piece has landedset it on the board addtoboard(boardfallingpiecescore +removecompletelines(boardlevelfallfreq calculatelevelandfallfreq(scorefallingpiece none elsepiece did not landjust move the block down fallingpiece[' '+ lastfalltime time time(the rate that the piece is naturally moving down (that isfallingis tracked by the lastfalltime variable if enough time has elapsed since the falling piece last fell down one spacelines to will handle dropping the piece by one space if the condition on line is truethen the piece has landed the call to addtoboard(will make the piece part of the board data structure (so that future pieces can land on it)and the removecompletelines(call will handle erasing any complete lines on the board and pulling the boxes down the removecompletelines(function also returns an integer value of how many lines were removedso we add this number to the score because the score may have changedwe call the calculatelevelandfallfreq(function to update the current level and frequency that the pieces fall and finallywe set the fallingpiece variable to none to indicate that the next piece should become the new falling pieceand random new piece should be generated for the new next piece (that is done on lines to at the beginning of the game loop if the piece has not landedwe simply set its position down one space (on line and reset lastfalltime to the current time (on line drawing everything on the screen drawing everything on the screen displaysurf fill(bgcolordrawboard(boardemail questions to the authoral@inventwithpython com