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
↓ 1 callers
Function
getNewBoard
Returns a dictionary that represents a Four in a Row board. The keys are (columnIndex, rowIndex) tuples of two integers, and the values are o
src/gamesbyexample/fourinarow.py:54
↓ 1 callers
Function
getNewBoard
Return a board data structure with the starting tiles.
src/gamesbyexample/reversegam.py:60
↓ 1 callers
Function
getNewBoard
Return a dictionary representing a Mancala board in the starting state: 4 seeds in each pit and 0 in the stores.
src/gamesbyexample/mancala.py:73
↓ 1 callers
Function
getNewBoard
Set up a board data structure with empty spaces.
src/gamesbyexample/chancecheckers.py:48
↓ 1 callers
Function
getNewBoard
Return a dictionary that represent the board. The keys are (x, y) integer tuples for positions and the values are one of the animal piece cons
src/gamesbyexample/barca.py:106
↓ 1 callers
Function
getNewBoard
Return a dictionary representing a board for a new game.
src/gamesbyexample/pegsolitaire.py:36
↓ 1 callers
Function
getNewBoard
Returns a dictionary representing the board. The keys are (x, y) tuples and the values are '~' and '.' strings to represent waves.
src/gamesbyexample/sonar.py:17
↓ 1 callers
Function
getNewBoard
Returns a new data structure that represents a board. It's a dictionary with keys of (x, y) tuples and values of the tile at that space. The
src/gamesbyexample/twentyfortyeight.py:39
↓ 1 callers
Function
getNewBoard
Returns a new dictionary that represents the board. The keys are (x, y) tuples of integers starting at 0 and going up to, but not including, B
src/gamesbyexample/gomoku.py:59
↓ 1 callers
Function
getNewBoard
Return a new dictionary that represents the board. The keys are (x, y) tuples and the values are X_PLAYER, O_PLAYER, or EMPTY_SPACE. There is
src/gamesbyexample/hexapawn.py:88
↓ 1 callers
Function
getNewBoard
Set up a board data structure with empty spaces.
src/gamesbyexample/checkers.py:42
↓ 1 callers
Function
getNewBoard
Return a dictionary of a new Flood It board.
src/gamesbyexample/flooder.py:88
↓ 1 callers
Function
getNewBoard
()
src/gamesbyexample/pygame_games/fourinarow.py:169
↓ 1 callers
Function
getNewBoard
()
src/gamesbyexample/pygame_games/flippy.py:326
↓ 1 callers
Function
getNewFloor
Return a dictionary to represent the color of the "floor". The keys are (x, y) integer tuples and the values are color strings such as 'red' o
src/gamesbyexample/floorpainters.py:83
↓ 1 callers
Function
getNewPuzzle
Get a new puzzle by making random slides from a solved state.
src/gamesbyexample/slidingtilepuzzle.py:127
↓ 1 callers
Method
getNextBodyPart
Calls the appropriate display method for the next body part that needs to be displayed. Sets partToDisplayNext to None when finished.
src/gamesbyexample/ducklings.py:189
↓ 1 callers
Method
getNextBodyPart
()
javascript_games/ducklings.js:223
↓ 1 callers
Function
getNumberForNthLetter
Returns the integer form of a letter. The integer of 'A' is 0, the integer of 'B' is 1, the integer of 'C' is 2, and so on.
src/gamesbyexample/hexapawn.py:117
↓ 1 callers
Function
getPieceMovements
Return a list of (x, y) tuples representing spaces that hold pieces that the player can move according to Barca rules.
src/gamesbyexample/barca.py:247
↓ 1 callers
Function
getPlayerGuess
Returns the letter the player entered. This function makes sure the player entered a single letter they haven't guessed before.
src/gamesbyexample/hangmanunfair.py:140
↓ 1 callers
Function
getPlayerGuess
Returns the letter the player entered. This function makes sure the player entered a single letter they haven't guessed before.
src/gamesbyexample/guillotine.py:144
↓ 1 callers
Function
getPlayerGuess
Returns the letter the player entered. This function makes sure the player entered a single letter they haven't guessed before.
src/gamesbyexample/hangman.py:147
↓ 1 callers
Function
getPlayerNames
Ask how many players there are.
src/gamesbyexample/ghostleglottery.py:55
↓ 1 callers
Function
getPotentialMoves
(board, tile, lookAhead)
src/gamesbyexample/pygame_games/fourinarow.py:273
↓ 1 callers
Function
getProgressBar
Returns a string that represents a progress bar that has barWidth bars and has progressed progress amount out of a total amount.
src/gamesbyexample/progressbar.py:32
↓ 1 callers
Function
getRandomChests
Return a list of (x, y) integer tuples that represent treasure chest locations.
src/gamesbyexample/sonar.py:61
↓ 1 callers
Function
getRandomMove
(board, lastMove=None)
src/gamesbyexample/pygame_games/slidepuzzle.py:180
↓ 1 callers
Function
getRandomNeighbor
(x, y)
src/gamesbyexample/slitheringsnakes.py:167
↓ 1 callers
Function
getRandomPuzzle
Return a string representing a randomly selected puzzle. Here are three example puzzles from parkingvaletpuzzles.txt: BB.K..GI.KCCGIAAL.HDD.LM
src/gamesbyexample/parkingvalet.py:45
↓ 1 callers
Function
getScore
Returns the sum of all the tiles on the board data structure.
src/gamesbyexample/twentyfortyeight.py:109
↓ 1 callers
Function
getSecretNum
Returns a string made up of NUM_DIGITS unique random digits.
src/gamesbyexample/bagels.py:59
↓ 1 callers
Function
getSpaceClicked
(mousex, mousey)
src/gamesbyexample/pygame_games/flippy.py:291
↓ 1 callers
Function
getSpotClicked
(board, x, y)
src/gamesbyexample/pygame_games/slidepuzzle.py:204
↓ 1 callers
Function
getSwappingGems
(board, firstXY, secondXY)
src/gamesbyexample/pygame_games/gemgem.py:235
↓ 1 callers
Function
getValidMoves
(board, player, flipTally)
src/gamesbyexample/royalgameofur.py:215
↓ 1 callers
Function
getWords
Return a list of 12 words that could possibly be the password. The secret password will be the first word in the list. To make the game fair,
src/gamesbyexample/hacking.py:52
↓ 1 callers
Function
hasLost
Return True if player has no checkers, otherwise False.
src/gamesbyexample/chancecheckers.py:274
↓ 1 callers
Function
hasLost
Return True if player has no checkers, otherwise False.
src/gamesbyexample/checkers.py:284
↓ 1 callers
Function
hasWon
Return True if the 'A' car has reached the right edge.
src/gamesbyexample/parkingvalet.py:197
↓ 1 callers
Function
hasWon
Return True if the entire board is one color/shape.
src/gamesbyexample/flooder.py:208
↓ 1 callers
Function
hasWon
(board)
src/gamesbyexample/pygame_games/inkspill.py:159
↓ 1 callers
Function
hasWon
(revealedBoxes)
src/gamesbyexample/pygame_games/memorypuzzle.py:284
↓ 1 callers
Function
highlightSpace
(x, y)
src/gamesbyexample/pygame_games/gemgem.py:428
↓ 1 callers
Function
isBlocked
Returns True if the (x, y) position on the map is blocked by a wall or star, otherwise return False.
src/gamesbyexample/pygame_games/starpusher.py:315
↓ 1 callers
Function
isBoardFull
Return True if every space on the board has been taken.
src/gamesbyexample/tictactoe.py:85
↓ 1 callers
Function
isBoardFull
Returns True if the board is full of tiles, otherwise, returns False if there is an empty space somewhere on the board.
src/gamesbyexample/gomoku.py:184
↓ 1 callers
Method
isBoardFull
Return True if every space on the board has been taken.
src/gamesbyexample/tictactoeoop.py:87
↓ 1 callers
Function
isCompleteLine
(board, y)
src/gamesbyexample/pygame_games/tetromino.py:408
↓ 1 callers
Function
isCompleteLine
(board, y)
src/gamesbyexample/pygame_games/pentomino.py:635
↓ 1 callers
Function
isCompleteLine
(board, y)
src/gamesbyexample/pygame_games/tetrominoforidiots.py:306
↓ 1 callers
Function
isFull
Returns True if the `board` has no empty spaces, otherwise returns False.
src/gamesbyexample/fourinarow.py:119
↓ 1 callers
Function
isFull
Returns True if the board data structure has no blanks.
src/gamesbyexample/twentyfortyeight.py:233
↓ 1 callers
Function
isLevelFinished
Returns True if all the goals have stars in them.
src/gamesbyexample/pygame_games/starpusher.py:584
↓ 1 callers
Function
isMatchingParens
(strToCheck)
src/gamesbyexample/matchingparens.py:37
↓ 1 callers
Function
isOnBoard
Returns True if (x, y) is on the board, otherwise False.
src/gamesbyexample/sonar.py:73
↓ 1 callers
Function
isOnBoard
(x, y)
src/gamesbyexample/pygame_games/tetromino.py:391
↓ 1 callers
Function
isOnBoard
(x, y)
src/gamesbyexample/pygame_games/pentomino.py:618
↓ 1 callers
Function
isOnBoard
(x, y)
src/gamesbyexample/pygame_games/tetrominoforidiots.py:289
↓ 1 callers
Function
isOnCorner
Returns True if the position is in one of the four corners.
src/gamesbyexample/reversegam.py:248
↓ 1 callers
Function
isOnCorner
(x, y)
src/gamesbyexample/pygame_games/flippy.py:478
↓ 1 callers
Function
isPrime
Returns True if number is prime, otherwise returns False.
src/gamesbyexample/primenumbers.py:35
↓ 1 callers
Method
isSolved
Returns True if the current grid is in a solved state.
src/gamesbyexample/sudoku.py:107
↓ 1 callers
Function
isValidSpace
Returns True if the space on the board is a valid space number and the space is blank.
src/gamesbyexample/tictactoe.py:65
↓ 1 callers
Method
isValidSpace
Returns True if the space on the board is a valid space number and the space is blank.
src/gamesbyexample/tictactoeoop.py:68
↓ 1 callers
Function
isValidTowerConfiguration
(towers)
tests/test_towerofhanoi.py:133
↓ 1 callers
Function
isWinner
Returns True if `playerTile` has four tiles in a row on `board`, otherwise returns False.
src/gamesbyexample/fourinarow.py:129
↓ 1 callers
Function
isWinner
Return True if the player occupies three of the four watering holes on this board.
src/gamesbyexample/barca.py:333
↓ 1 callers
Function
isWinner
Return True if player is a winner on this TTTBoard.
src/gamesbyexample/tictactoe.py:71
↓ 1 callers
Function
isWinner
Returns True if player has four tiles in a row on board, otherwise returns False.
src/gamesbyexample/gomoku.py:135
↓ 1 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/bouncinglines.py:131
↓ 1 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/rotatingcube.py:37
↓ 1 callers
Function
loadLevels
(levelFilename)
src/gamesbyexample/sokoban.py:156
↓ 1 callers
Function
main
()
inprogress/tsuromapmaker.py:121
↓ 1 callers
Function
main
()
src/gamesbyexample/towerofhanoi.py:15
↓ 1 callers
Function
main
()
src/gamesbyexample/slitheringsnakes.py:42
↓ 1 callers
Function
main
()
src/gamesbyexample/ducklings.py:42
↓ 1 callers
Function
main
()
src/gamesbyexample/hungryrobots.py:25
↓ 1 callers
Function
main
()
src/gamesbyexample/diamonds.py:14
↓ 1 callers
Function
main
()
src/gamesbyexample/hangmanunfair.py:68
↓ 1 callers
Function
main
()
src/gamesbyexample/blackjack.py:19
↓ 1 callers
Function
main
()
src/gamesbyexample/morsecode.py:27
↓ 1 callers
Function
main
()
src/gamesbyexample/ultimatetictactoe.py:23
↓ 1 callers
Function
main
()
src/gamesbyexample/alphabetizewordquiz.py:26
↓ 1 callers
Function
main
()
src/gamesbyexample/alphabetizequiz.py:18
↓ 1 callers
Function
main
()
src/gamesbyexample/lostkitty.py:25
↓ 1 callers
Function
main
()
src/gamesbyexample/tictactoeoop.py:12
↓ 1 callers
Function
main
()
src/gamesbyexample/bouncingdvd.py:43
↓ 1 callers
Function
main
()
src/gamesbyexample/sierpinskisgame.py:14
↓ 1 callers
Function
main
()
src/gamesbyexample/kochsnowflake.py:9
↓ 1 callers
Function
main
()
src/gamesbyexample/langtonsant.py:46
↓ 1 callers
Function
main
()
src/gamesbyexample/countingquiz.py:13
↓ 1 callers
Function
main
()
src/gamesbyexample/vacuumbot.py:49
↓ 1 callers
Function
main
()
src/gamesbyexample/bagels.py:14
↓ 1 callers
Function
main
()
src/gamesbyexample/railfencecipher.py:13
↓ 1 callers
Function
main
()
src/gamesbyexample/affinecipher.py:20
↓ 1 callers
Function
main
()
src/gamesbyexample/royalgameofur.py:51
↓ 1 callers
Function
main
()
src/gamesbyexample/bouncingdots.py:45
↓ 1 callers
Function
main
()
src/gamesbyexample/slidingtilepuzzle.py:11
↓ 1 callers
Function
main
()
src/gamesbyexample/fireflies.py:40
← previous
next →
401–500 of 712, ranked by callers