Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/asweigart/PythonStdioGames
/ functions
Functions
712 in github.com/asweigart/PythonStdioGames
⨍
Functions
712
◇
Types & classes
17
↓ 3 callers
Function
isValidMove
Returns False if the player's move on xstart, ystart is invalid. If it is a valid move, returns a list of spaces that would become the player'
src/gamesbyexample/reversegam.py:87
↓ 3 callers
Function
isValidMove
(board, tile, xstart, ystart)
src/gamesbyexample/pygame_games/flippy.py:335
↓ 3 callers
Function
line
Returns a list of points in a line between the given points. Uses the Bresenham line algorithm. More info at: https://en.wikipedia.org/wiki/B
src/gamesbyexample/vacuumbot.py:187
↓ 3 callers
Function
line
Returns a list of points in a line between (x1, y1) and (x2, y2). Uses the Bresenham line algorithm. More info at: https://en.wikipedia.org/w
src/gamesbyexample/analogclock.py:121
↓ 3 callers
Function
makeMove
Place a tile on the board, flipping any of the opponent's pieces. Returns False for invalid moves, True for valid.
src/gamesbyexample/reversegam.py:208
↓ 3 callers
Function
makeMove
(board, player, column)
src/gamesbyexample/pygame_games/fourinarow.py:132
↓ 3 callers
Function
makeMove
(board, move)
src/gamesbyexample/pygame_games/slidepuzzle.py:158
↓ 3 callers
Function
makeMove
(board, tile, xstart, ystart, realMove=False)
src/gamesbyexample/pygame_games/flippy.py:460
↓ 3 callers
Function
makeTextObjs
(text, font, color)
src/gamesbyexample/pygame_games/tetromino.py:303
↓ 3 callers
Function
makeTextObjs
(text, font, color)
src/gamesbyexample/pygame_games/pentomino.py:530
↓ 3 callers
Function
makeTextObjs
(text, font, color)
src/gamesbyexample/pygame_games/tetrominoforidiots.py:201
↓ 3 callers
Function
movePiece
Move the piece at moveFrom on the board to moveTo. These are (x, y) integer tuples.
src/gamesbyexample/barca.py:240
↓ 3 callers
Method
resetGrid
Reset the state of the grid, tracked by self.grid, to the state in self.originalSetup.
src/gamesbyexample/sudoku.py:38
↓ 3 callers
Function
showTextScreen
(text)
src/gamesbyexample/pygame_games/tetromino.py:325
↓ 3 callers
Function
showTextScreen
(text)
src/gamesbyexample/pygame_games/pentomino.py:552
↓ 3 callers
Function
showTextScreen
(text)
src/gamesbyexample/pygame_games/tetrominoforidiots.py:223
↓ 3 callers
Function
sleep
(seconds)
javascript_games/magicfortuneball.js:10
↓ 3 callers
Function
slideAnimation
(board, direction, message, animationSpeed)
src/gamesbyexample/pygame_games/slidepuzzle.py:255
↓ 3 callers
Function
slowPrint
Slowly print out the characters in text one at a time.
src/gamesbyexample/alphabetizewordquiz.py:91
↓ 3 callers
Function
slowPrint
Slowly print out the characters in text one at a time.
src/gamesbyexample/alphabetizequiz.py:63
↓ 3 callers
Function
translateBoardToPixelCoord
(x, y)
src/gamesbyexample/pygame_games/flippy.py:223
↓ 2 callers
Function
A1ToXy
Convert user-friendly coordinates (like A1 or B5) to (x, y) coordinates (like 0,0 or 1,4).
src/gamesbyexample/barca.py:324
↓ 2 callers
Method
__init__
(self, zombies)
src/gamesbyexample/zombiebitefight.py:91
↓ 2 callers
Function
adjustPoint
Adjusts the 3D XYZ point to a 2D XY point fit for displaying on the screen. This resizes this 2D point by a scale of SCALEX and SCALEY, then m
src/gamesbyexample/rotatingcube.py:137
↓ 2 callers
Function
animateDroppingToken
(board, column, color)
src/gamesbyexample/pygame_games/fourinarow.py:217
↓ 2 callers
Function
calculateLevelAndFallFreq
(score)
src/gamesbyexample/pygame_games/tetromino.py:357
↓ 2 callers
Function
calculateLevelAndFallFreq
(score)
src/gamesbyexample/pygame_games/pentomino.py:584
↓ 2 callers
Function
calculateLevelAndFallFreq
(score)
src/gamesbyexample/pygame_games/tetrominoforidiots.py:255
↓ 2 callers
Function
changeBackgroundAnimation
(animationSpeed=40)
src/gamesbyexample/pygame_games/simulate.py:192
↓ 2 callers
Function
checkForQuit
()
src/gamesbyexample/pygame_games/slidepuzzle.py:123
↓ 2 callers
Function
checkForQuit
()
src/gamesbyexample/pygame_games/tetromino.py:348
↓ 2 callers
Function
checkForQuit
()
src/gamesbyexample/pygame_games/pentomino.py:575
↓ 2 callers
Function
checkForQuit
()
src/gamesbyexample/pygame_games/tetrominoforidiots.py:246
↓ 2 callers
Function
convertToPixelCoords
(boxx, boxy)
src/gamesbyexample/pygame_games/tetromino.py:438
↓ 2 callers
Function
convertToPixelCoords
(boxx, boxy)
src/gamesbyexample/pygame_games/pentomino.py:665
↓ 2 callers
Function
convertToPixelCoords
(boxx, boxy)
src/gamesbyexample/pygame_games/tetrominoforidiots.py:336
↓ 2 callers
Function
copyIfPossible
Copy text to the clipboard if pyperclip is installed.
src/gamesbyexample/railfencecipher.py:85
↓ 2 callers
Function
coverBoxesAnimation
(board, boxesToCover)
src/gamesbyexample/pygame_games/memorypuzzle.py:229
↓ 2 callers
Method
display
Display the current state of the grid on the screen.
src/gamesbyexample/sudoku.py:84
↓ 2 callers
Function
displayBoard
Display the board, robots, and player on the screen.
src/gamesbyexample/hungryrobots.py:121
↓ 2 callers
Function
displayBoard
Display the board on the screen.
src/gamesbyexample/royalgameofur.py:191
↓ 2 callers
Function
displayBoard
Display the board on the screen.
src/gamesbyexample/pegsolitaire.py:49
↓ 2 callers
Function
displayBoard
Display the board on the screen.
src/gamesbyexample/parkingvalet.py:94
↓ 2 callers
Function
displayBoard
Displays the board on the screen.
src/gamesbyexample/sonar.py:30
↓ 2 callers
Function
displayBoard
Display the board on the screen.
src/gamesbyexample/hexapawn.py:123
↓ 2 callers
Function
displayCards
Display the cards in "cards", which is a list of (rank, suit) tuples.
src/gamesbyexample/threecardmonte.py:28
↓ 2 callers
Function
displayCards
(allCards)
barebones/blackjack-barebones.py:107
↓ 2 callers
Function
displayDisk
Display a disk of the given width. A width of 0 means no disk.
src/gamesbyexample/towerofhanoi.py:98
↓ 2 callers
Function
displayGhostLegs
Display all of the legs and any current paths on them.
src/gamesbyexample/ghostleglottery.py:116
↓ 2 callers
Function
displayLeglessRow
Display a row that contains just the poles and no legs.
src/gamesbyexample/ghostleglottery.py:196
↓ 2 callers
Function
displayLetterLabels
Display a row of letter labels, based on the BOARD_WIDTH.
src/gamesbyexample/gomoku.py:87
↓ 2 callers
Function
displayLevel
(levelNum, maxLevelNum, levelData)
src/gamesbyexample/sokoban.py:192
↓ 2 callers
Function
displayMap
Display the map, with visited intersections and the player's current position.
src/gamesbyexample/lostkitty.py:111
↓ 2 callers
Function
displayMaze
(maze)
src/gamesbyexample/mazerunner2d.py:19
↓ 2 callers
Function
displayMaze
(maze, travelerX=None, travelerY=None)
src/gamesbyexample/mazemakerrec.py:23
↓ 2 callers
Function
displayRails
Display the letters in the rails.
src/gamesbyexample/railfencecipher.py:57
↓ 2 callers
Function
displayTowers
Display the current state.
src/gamesbyexample/towerofhanoi.py:81
↓ 2 callers
Function
drawBoard
Draws the board data structure on the screen.
src/gamesbyexample/twentyfortyeight.py:74
↓ 2 callers
Function
drawBoard
(board)
src/gamesbyexample/pygame_games/gemgem.py:518
↓ 2 callers
Function
drawBox
(boxx, boxy, color, pixelx=None, pixely=None)
src/gamesbyexample/pygame_games/tetromino.py:444
↓ 2 callers
Function
drawBox
(boxx, boxy, color, pixelx=None, pixely=None)
src/gamesbyexample/pygame_games/pentomino.py:671
↓ 2 callers
Function
drawBox
(boxx, boxy, color, pixelx=None, pixely=None)
src/gamesbyexample/pygame_games/tetrominoforidiots.py:342
↓ 2 callers
Function
drawBoxCovers
(board, boxes, coverage)
src/gamesbyexample/pygame_games/memorypuzzle.py:209
↓ 2 callers
Function
drawGuillotine
Draw the current state of the guillotine, along with the missed and correctly-guessed letters of the secret word.
src/gamesbyexample/guillotine.py:117
↓ 2 callers
Function
drawHangman
Draw the current state of the hangman, along with the missed and correctly-guessed letters of the secret word.
src/gamesbyexample/hangmanunfair.py:113
↓ 2 callers
Function
drawHangman
Draw the current state of the hangman, along with the missed and correctly-guessed letters of the secret word.
src/gamesbyexample/hangman.py:120
↓ 2 callers
Function
drawIcon
(shape, color, boxx, boxy)
src/gamesbyexample/pygame_games/memorypuzzle.py:182
↓ 2 callers
Function
drawInfo
(board, playerTile, computerTile, turn)
src/gamesbyexample/pygame_games/flippy.py:304
↓ 2 callers
Function
drawLevel
(levelNum, levelData)
inprogress/stickyhands.py:69
↓ 2 callers
Function
drawLifeMeter
(currentLife)
src/gamesbyexample/pygame_games/inkspill.py:384
↓ 2 callers
Function
drawLinesBetweenPoints
Prints a line of characters between the specified points.
src/gamesbyexample/bouncinglines.py:115
↓ 2 callers
Function
drawPiece
(piece, pixelx=None, pixely=None)
src/gamesbyexample/pygame_games/tetromino.py:483
↓ 2 callers
Function
drawPiece
(piece, pixelx=None, pixely=None)
src/gamesbyexample/pygame_games/pentomino.py:710
↓ 2 callers
Function
drawPiece
(piece, pixelx=None, pixely=None)
src/gamesbyexample/pygame_games/tetrominoforidiots.py:381
↓ 2 callers
Function
drawPressKeyMsg
()
src/gamesbyexample/pygame_games/wormy.py:110
↓ 2 callers
Function
drawScore
(score)
src/gamesbyexample/pygame_games/gemgem.py:542
↓ 2 callers
Method
dropOnColumn
(self, column)
inprogress/dropspin.py:74
↓ 2 callers
Function
enter1Through9
Presents a "minimap" of a tic-tac-toe board's spaces, labeled with numbers 1 through 9. Returns the numeric space they chose. Valid moves is a
src/gamesbyexample/ultimatetictactoe.py:210
↓ 2 callers
Function
fillBoardAndAnimate
(board, points, score)
src/gamesbyexample/pygame_games/gemgem.py:486
↓ 2 callers
Function
findMatchingGems
(board)
src/gamesbyexample/pygame_games/gemgem.py:394
↓ 2 callers
Function
flashBorderAnimation
(color, board, animationSpeed=30)
src/gamesbyexample/pygame_games/inkspill.py:269
↓ 2 callers
Function
flashButtonAnimation
(color, animationSpeed=50)
src/gamesbyexample/pygame_games/simulate.py:151
↓ 2 callers
Function
generateNewPuzzle
(numSlides)
src/gamesbyexample/pygame_games/slidepuzzle.py:296
↓ 2 callers
Function
generateRandomBoard
(width, height, difficulty=MEDIUM)
src/gamesbyexample/pygame_games/inkspill.py:300
↓ 2 callers
Function
getBet
Ask the player how much they want to bet for this round.
src/gamesbyexample/blackjack.py:123
↓ 2 callers
Function
getBirthdays
Returns a list of number random date objects for birthdays.
src/gamesbyexample/birthdayparadox.py:10
↓ 2 callers
Function
getBirthdays
Returns a list of birthday dates.
barebones/birthdayparadox-barebones.py:6
↓ 2 callers
Function
getBlankRails
Lay out the letters in message on key number of rails.
src/gamesbyexample/railfencecipher.py:49
↓ 2 callers
Function
getBoard
Return a board data structure based on the puzzle string.
src/gamesbyexample/parkingvalet.py:69
↓ 2 callers
Function
getBoardCopyMinusGems
(board, gems)
src/gamesbyexample/pygame_games/gemgem.py:527
↓ 2 callers
Function
getBounceAmount
(currentBounce, bounceRate, bounceHeight)
src/gamesbyexample/pygame_games/squirrel.py:329
↓ 2 callers
Function
getCanvasString
Returns a multiline string of the line drawn in canvasData.
src/gamesbyexample/etchingdrawer.py:51
↓ 2 callers
Function
getDistance
Returns the distance between (x1, y1) and (x2, y2) by using the Pythagorean Theorem.
src/gamesbyexample/lostkitty.py:65
↓ 2 callers
Function
getMatch
Returns the date object of a birthday that occurs more than once in the birthdays list.
src/gamesbyexample/birthdayparadox.py:25
↓ 2 callers
Function
getMatch
Returns the birthday that occurs more than once in the list.
barebones/birthdayparadox-barebones.py:52
↓ 2 callers
Function
getNeighboringSpaces
Return the two spaces in the direction from the space argument.
src/gamesbyexample/pegsolitaire.py:67
↓ 2 callers
Function
getNewBoard
Return a list of lists that represents a new tile puzzle.
src/gamesbyexample/slidingtilepuzzle.py:34
↓ 2 callers
Function
getNthLetter
Returns the "nth" letter, where nth is an integer. The 0th letter is 'A', the 1st letter is 'B', the 2nd letter is 'C', and so on.
src/gamesbyexample/hexapawn.py:111
↓ 2 callers
Function
getOrdIndicator
Returns the "ordinal indicator" of number, e.g. 'st' for 1 and 'rd' for 23, because we write them as "1st" and "23rd".
src/gamesbyexample/lostkitty.py:85
↓ 2 callers
Function
getPlayerBlobPoints
(levelData, playerx, playery)
inprogress/stickyhands.py:78
← previous
next →
101–200 of 712, ranked by callers