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
↓ 2 callers
Function
getRailCoordinates
Return a list of x, y coordinates of the zig zag order rail.
src/gamesbyexample/railfencecipher.py:65
↓ 2 callers
Function
getRandomCard
Returns a random card that is NOT the Queen of Hearts.
src/gamesbyexample/threecardmonte.py:46
↓ 2 callers
Function
getRandomLocation
()
src/gamesbyexample/pygame_games/wormy.py:164
↓ 2 callers
Function
getRandomOffCameraPos
(camerax, cameray, objWidth, objHeight)
src/gamesbyexample/pygame_games/squirrel.py:344
↓ 2 callers
Function
getRandomizedBoard
()
src/gamesbyexample/pygame_games/memorypuzzle.py:133
↓ 2 callers
Function
getScoreOfBoard
Returns a dictionary with keys 'X' and 'O', whose values.
src/gamesbyexample/reversegam.py:170
↓ 2 callers
Function
getStartingBoard
()
src/gamesbyexample/pygame_games/slidepuzzle.py:132
↓ 2 callers
Function
getValidMoves
Return a list of valid moves that can be made on the board.
src/gamesbyexample/parkingvalet.py:125
↓ 2 callers
Function
getValidMoves
Return a list of board space labels that have a player piece that can make a move.
src/gamesbyexample/hexapawn.py:227
↓ 2 callers
Function
isOnBoard
Returns True if (x, y) is a position on the board, otherwise returns False.
src/gamesbyexample/barca.py:193
↓ 2 callers
Function
isOutsideActiveArea
(camerax, cameray, obj)
src/gamesbyexample/pygame_games/squirrel.py:386
↓ 2 callers
Function
leftTopPixelCoordOfBox
(boxx, boxy)
src/gamesbyexample/pygame_games/inkspill.py:429
↓ 2 callers
Function
makeMove
Carry out the given move on the given board.
src/gamesbyexample/slidingtilepuzzle.py:96
↓ 2 callers
Function
makeMove
Change the board data structure with a sonar device character. Remove treasure chests from the chests list as they are found. Return False if
src/gamesbyexample/sonar.py:77
↓ 2 callers
Function
makeNewGrass
(camerax, cameray)
src/gamesbyexample/pygame_games/squirrel.py:376
↓ 2 callers
Function
pieceCanAdvance
Return True if the player's piece at (x, y) on the board can move forward. Otherwise return False.
src/gamesbyexample/hexapawn.py:241
↓ 2 callers
Function
pieceCanCaptureLeft
Return True if the player's piece at (x, y) on the board can capture the piece forward and left. Otherwise return False.
src/gamesbyexample/hexapawn.py:254
↓ 2 callers
Function
pieceCanCaptureRight
Return True if the player's piece at (x, y) on the board can capture the piece forward and right. Otherwise return False.
src/gamesbyexample/hexapawn.py:269
↓ 2 callers
Function
resetAnimation
(board, allMoves)
src/gamesbyexample/pygame_games/slidepuzzle.py:314
↓ 2 callers
Function
revealBoxesAnimation
(board, boxesToReveal)
src/gamesbyexample/pygame_games/memorypuzzle.py:223
↓ 2 callers
Method
rotateLeft
(self)
inprogress/dropspin.py:108
↓ 2 callers
Method
rotateRight
(self)
inprogress/dropspin.py:98
↓ 2 callers
Function
sleep
(seconds)
javascript_games/dna.js:11
↓ 2 callers
Function
sleep
(seconds)
javascript_games/digitalstream.js:8
↓ 2 callers
Function
sleep
(seconds)
javascript_games/deepcave.js:8
↓ 2 callers
Function
sleep
(seconds)
javascript_games/snailrace.js:10
↓ 2 callers
Function
sleep
(seconds)
javascript_games/ducklings.js:17
↓ 2 callers
Function
startGameAnimation
(board)
src/gamesbyexample/pygame_games/memorypuzzle.py:254
↓ 2 callers
Function
terminate
()
src/gamesbyexample/pygame_games/simulate.py:137
↓ 2 callers
Function
terminate
()
src/gamesbyexample/pygame_games/slidepuzzle.py:118
↓ 2 callers
Function
terminate
()
src/gamesbyexample/pygame_games/squirrel.py:324
↓ 2 callers
Function
terminate
()
src/gamesbyexample/pygame_games/tetromino.py:308
↓ 2 callers
Function
terminate
()
src/gamesbyexample/pygame_games/pentomino.py:535
↓ 2 callers
Function
terminate
()
src/gamesbyexample/pygame_games/tetrominoforidiots.py:206
↓ 2 callers
Function
translateMessage
Encrypt or decrypt the message using the key.
src/gamesbyexample/vigenerecipher.py:73
↓ 2 callers
Function
translateMessage
Encrypt or decrypt the message using the key.
src/gamesbyexample/simplesubcipher.py:93
↓ 2 callers
Function
xyToA1
Convert (x, y) coordinates (like 0,0 or 1,4) to user-friendly coordinates (like A1 or B5).
src/gamesbyexample/barca.py:318
↓ 1 callers
Method
_generateRandom
(self, steps=100)
inprogress/dropspin.py:118
↓ 1 callers
Function
addRobots
Add NUM_ROBOTS number of robots to empty spaces on the board and return a list of these (x, y) spaces where robots are now located.
src/gamesbyexample/hungryrobots.py:111
↓ 1 callers
Function
addToBoard
(board, piece)
src/gamesbyexample/pygame_games/tetromino.py:375
↓ 1 callers
Function
addToBoard
(board, piece)
src/gamesbyexample/pygame_games/pentomino.py:602
↓ 1 callers
Function
addToBoard
(board, piece)
src/gamesbyexample/pygame_games/tetrominoforidiots.py:273
↓ 1 callers
Function
addTwoToBoard
Adds a new 2 tile randomly to the board.
src/gamesbyexample/twentyfortyeight.py:224
↓ 1 callers
Function
amountOfDivisors
(number)
src/gamesbyexample/ulamspiral.py:46
↓ 1 callers
Function
animateComputerMoving
(board, column)
src/gamesbyexample/pygame_games/fourinarow.py:234
↓ 1 callers
Function
animateTileChange
(tilesToFlip, tileColor, additionalTile)
src/gamesbyexample/pygame_games/flippy.py:227
↓ 1 callers
Function
askForBoardSize
Returns a (width, height) tuple of the board dimensions the player has requested.
src/gamesbyexample/hexapawn.py:63
↓ 1 callers
Function
askForGuess
()
src/gamesbyexample/guess.py:9
↓ 1 callers
Function
askForGuess
()
javascript_games/guess.js:10
↓ 1 callers
Function
askForPlayerGuess
Let the player enter a password guess.
src/gamesbyexample/hacking.py:165
↓ 1 callers
Function
askForPlayerMove
Asks the player for a move. Returns (fromTower, toTower).
src/gamesbyexample/towerofhanoi.py:46
↓ 1 callers
Function
askForPlayerMove
Returns the (x, y) integer tuple of the place the player moves next, given their current location and the walls of the board.
src/gamesbyexample/hungryrobots.py:140
↓ 1 callers
Function
askForPlayerMove
Asks the player which space on which small board to move on. The focusX and focusY values determine which small board the player can move on,
src/gamesbyexample/ultimatetictactoe.py:168
↓ 1 callers
Function
askForPlayerMove
Let the player enter which direction they want to move, or if they want to quit. Make sure the player can't move off the edge of the map.
src/gamesbyexample/lostkitty.py:167
↓ 1 callers
Function
askForPlayerMove
Let the player select a tile to slide.
src/gamesbyexample/slidingtilepuzzle.py:76
↓ 1 callers
Function
askForPlayerMove
Let a player select a column on the board to drop a tile into. Returns a tuple of the (column, row) that the tile falls into.
src/gamesbyexample/fourinarow.py:90
↓ 1 callers
Function
askForPlayerMove
Let the player type in their move. Returns the move as [x, y] (or returns the string 'QUIT')
src/gamesbyexample/reversegam.py:184
↓ 1 callers
Function
askForPlayerMove
Asks the player which pit on their side of the board they select to sow seeds from. Returns the uppercase letter label of the selected pit as
src/gamesbyexample/mancala.py:111
↓ 1 callers
Function
askForPlayerMove
Ask the player to select a move.
src/gamesbyexample/chancecheckers.py:187
↓ 1 callers
Function
askForPlayerMove
Let the player enter their move.
src/gamesbyexample/pegsolitaire.py:121
↓ 1 callers
Function
askForPlayerMove
Let the player enter the car and direction they want to move.
src/gamesbyexample/parkingvalet.py:207
↓ 1 callers
Function
askForPlayerMove
Returns an (x, y) tuple of the player's move.
src/gamesbyexample/sonar.py:103
↓ 1 callers
Function
askForPlayerMove
(maxLevelNum)
src/gamesbyexample/sokoban.py:210
↓ 1 callers
Function
askForPlayerMove
Asks the player for the direction of their next move (or quit). Ensures they enter a valid move: either 'W', 'A', 'S' or 'D'.
src/gamesbyexample/twentyfortyeight.py:205
↓ 1 callers
Function
askForPlayerMove
Asks the player for a move and returns a (x, y) tuple of integer indexes for the place they want to put their tile. Also returns (None, None)
src/gamesbyexample/gomoku.py:95
↓ 1 callers
Function
askForPlayerMove
Ask the player to select a move. Returns a tuple with the board space label of the piece to move, followed by where to move it. If there are n
src/gamesbyexample/checkers.py:183
↓ 1 callers
Function
askForPlayerMove
Let the player select a color to paint the upper left tile.
src/gamesbyexample/flooder.py:136
↓ 1 callers
Function
canMakeMove
(board)
src/gamesbyexample/pygame_games/gemgem.py:273
↓ 1 callers
Function
changeTile
Change the color/shape of a tile using the recursive flood fill algorithm.
src/gamesbyexample/flooder.py:184
↓ 1 callers
Function
checkForKeyPress
()
src/gamesbyexample/pygame_games/tetromino.py:313
↓ 1 callers
Function
checkForKeyPress
()
src/gamesbyexample/pygame_games/pentomino.py:540
↓ 1 callers
Function
checkForKeyPress
()
src/gamesbyexample/pygame_games/tetrominoforidiots.py:211
↓ 1 callers
Function
checkForQuit
()
src/gamesbyexample/pygame_games/inkspill.py:147
↓ 1 callers
Function
checkForWinner
Looks at board and returns either '1' or '2' if there is a winner or 'tie' or 'no winner' if there isn't. The game ends when a player's pits a
src/gamesbyexample/mancala.py:180
↓ 1 callers
Function
checkIfPlayerHasWon
Return True if there is only one peg left on the board.
src/gamesbyexample/pegsolitaire.py:184
↓ 1 callers
Function
checkIfPlayerReachedEnd
Return True if the player has reached the opposite end of the board and won. Otherwise return False.
src/gamesbyexample/hexapawn.py:284
↓ 1 callers
Function
checkKey
Return True if key is valid. Otherwise return False.
src/gamesbyexample/simplesubcipher.py:71
↓ 1 callers
Function
clearAquarium
Draw empty spaces over everything on the screen.
src/gamesbyexample/fishtank.py:266
↓ 1 callers
Function
clearScreen
Clear the terminal window screen by running cls or clear.
src/gamesbyexample/fireflies.py:192
↓ 1 callers
Function
combineTilesInColumn
The column is a list of four tile. Index 0 is the "bottom" of the column, and tiles are pulled "down" and combine if they are the same. For ex
src/gamesbyexample/twentyfortyeight.py:121
↓ 1 callers
Function
createNewForest
Returns a dictionary for a new forest data structure.
src/gamesbyexample/forestfiresim.py:78
↓ 1 callers
Function
decorateMap
Makes a copy of the given map object and modifies it. Here is what is done to it: * Walls that are corners are turned into corner pieces.
src/gamesbyexample/pygame_games/starpusher.py:275
↓ 1 callers
Function
decryptMessage
(message, key)
src/gamesbyexample/railfencecipher.py:118
↓ 1 callers
Function
decryptMessage
Decrypt the message using the key.
src/gamesbyexample/affinecipher.py:114
↓ 1 callers
Function
decryptMessage
Decrypt the message using the key.
src/gamesbyexample/vigenerecipher.py:68
↓ 1 callers
Function
decryptMessage
Decrypt the message using the key.
src/gamesbyexample/simplesubcipher.py:88
↓ 1 callers
Method
display
(self)
inprogress/dropspin.py:38
↓ 1 callers
Method
display
(self)
src/gamesbyexample/slitheringsnakes.py:160
↓ 1 callers
Method
display
(self)
src/gamesbyexample/zombiebitefight.py:120
↓ 1 callers
Function
displayAbacus
(number)
src/gamesbyexample/soroban.py:80
↓ 1 callers
Function
displayBoard
Displays the board and ants on the screen. The changedTiles argument is a list of (x, y) tuples for tiles on the screen that have changed and
src/gamesbyexample/langtonsant.py:122
↓ 1 callers
Function
displayBoard
Display the given board on the screen.
src/gamesbyexample/slidingtilepuzzle.py:40
↓ 1 callers
Function
displayBoard
Display the board on the screen.
src/gamesbyexample/barca.py:127
↓ 1 callers
Function
displayClue
Display a clue telling the player that the cat is very near, near, far, or very far away.
src/gamesbyexample/lostkitty.py:71
↓ 1 callers
Function
displayControls
()
src/gamesbyexample/soroban.py:142
↓ 1 callers
Function
displayFilledDiamond
(size)
src/gamesbyexample/diamonds.py:41
↓ 1 callers
Function
displayFilledDiamond
(size)
javascript_games/diamonds.js:49
↓ 1 callers
Function
displayFireflies
(lightPoints, darkPoints)
src/gamesbyexample/fireflies.py:178
↓ 1 callers
Function
displayForest
Display the forest data structure on the screen.
src/gamesbyexample/forestfiresim.py:90
↓ 1 callers
Function
displayOutlineDiamond
(size)
src/gamesbyexample/diamonds.py:25
← previous
next →
201–300 of 712, ranked by callers