1/12
Vocabulary flashcards detailing each function used in Frodo's Way Home, including parameters, return types, call locations in main, and authorship attribution.
roll_die
A team-written function with parameter sides (default 3) that returns a random int from 1 to sides. It is called in the turn loop after the player picks 1 (Roll), and called again if the collar is on.
move_frodo
A team-written function with parameters position, roll, and board_len (default 50) that returns the new position (max 50). It is called in the turn loop right after roll_die.
load_board
A team-written function with parameter filename that returns a list of (description, score) tuples. It is called once at the start: cardOptions = load_board("cards.csv").
draw_map
An AI-assisted function with parameters position and board_len (default 50) that returns the grid (list of lists) and prints it. It is called in the turn loop right after move_frodo.
printCard
A team-written function that takes no parameters (nothing) and returns treats and health change while also printing the card. It is called in the turn loop after draw_map.
newCard
A team-written function that takes no parameters (nothing) and returns card text, treats, and health change. It is not called by main; it is called by printCard.
show_powerups
A team-written function with parameter powerups that prints counts and returns 1 if any owned, or 0 if none. It is called in Menu option 3 and menu option 4 (Status).
buy_item
A team-written function with parameters item, shop, stats, and powerups that returns True if bought and False if not. It is not called by main; it is called by open_shop.
open_shop
A team-written function with parameters shop, stats, powerups, and log that returns nothing but changes stats, powerups, and log. It is called in Menu option 2 (Shop).
use_powerup
A team-written function with parameters item and game that returns True if used and False if not. It is called in Menu option 3, inside the for/else name check.
check_game_over
A team-written function with parameters stats (health), position, and board_len that returns "win", "lose", or "in progress". It is called in the turn loop's while condition, before rolling, and after the loop.
log_turn
A team-written function with parameters log, turn, action, and result that returns nothing (appends to log). It is called at the end of every turn, and when the player quits.
write_log
A team-written function with parameters log, stats, turns, and filename that returns nothing (writes frodo_log.txt). It is called once, after the turn loop ends.