Skip to content
This repository was archived by the owner on Mar 12, 2026. It is now read-only.

Implement choose-your-own-adventure game with OOP, file I/O, and type safety#1

Closed
BraydenPierce with Copilot wants to merge 6 commits into
mainfrom
copilot/create-adventure-story-game
Closed

Implement choose-your-own-adventure game with OOP, file I/O, and type safety#1
BraydenPierce with Copilot wants to merge 6 commits into
mainfrom
copilot/create-adventure-story-game

Conversation

Copilot AI commented Jan 29, 2026

Copy link
Copy Markdown

Implements CS3620 Project 1: a mystery/thriller adventure game meeting all specified requirements.

Implementation

Core game (adventure_game.py)

  • StoryNode class: narrative segments with choices and state
  • Adventure class: game engine managing 54 story nodes, inventory, score, and progression
  • JSON-based save/load system with error handling
  • 50 decision points across 4 endings (best, good, moderate, bad)

Technical requirements

  • Type hints throughout: Dict[str, str], List[str], Optional[str], Callable
  • Control structures: while loops (game loop), for loops (iteration), if/elif/else (logic), try/except (file I/O)
  • Functional patterns: lambda for file filtering, list comprehensions
  • 15+ functions including save/load, display, navigation, and validation methods

Example usage

from adventure_game import Adventure

game = Adventure()
game.play()  # Interactive gameplay

# Save/load support
game.save_game()  # Writes JSON with player state, inventory, score
game.load_game()  # Restores from adventure_save.json

Testing & Documentation

  • test_game.py: 6 automated tests validating OOP, file I/O, story structure, type hints
  • demo_playthrough.py: demonstrates complete path to best ending
  • Documentation: README, requirements verification, code examples

Metrics

  • 54 narratives (270% of 20 required)
  • 50 decision points (500% of 10 required)
  • 100% type hint coverage
Original prompt

These are the project requirements:
An Entertaining Adventure Story (No lorem Ipsum)
Use of Functional and/or Object-Oriented Programming.
Use of Control Structures, Functions, File Handling (Ex: Can choose a specific file to load to make a decision or write the user's adventure to a file), and Python Types.
A Minimum of 10 User Decision Points.
A Minimum of 20 Narratives.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 5 commits January 29, 2026 18:06
Co-authored-by: BraydenPierce <144150181+BraydenPierce@users.noreply.github.com>
Co-authored-by: BraydenPierce <144150181+BraydenPierce@users.noreply.github.com>
Co-authored-by: BraydenPierce <144150181+BraydenPierce@users.noreply.github.com>
Co-authored-by: BraydenPierce <144150181+BraydenPierce@users.noreply.github.com>
Co-authored-by: BraydenPierce <144150181+BraydenPierce@users.noreply.github.com>
Copilot AI changed the title [WIP] Add entertaining adventure story with user decision points Implement choose-your-own-adventure game with OOP, file I/O, and type safety Jan 29, 2026
Copilot AI requested a review from BraydenPierce January 29, 2026 18:13
@BraydenPierce

Copy link
Copy Markdown
Owner

@copilot how can I set a default name for a character if the user doesnt enter one?

Copilot AI commented Jan 29, 2026

Copy link
Copy Markdown
Author

@copilot how can I set a default name for a character if the user doesnt enter one?

The code already handles this on lines 851-853 of adventure_game.py:

self.player_name = input("\nEnter your detective name: ").strip()
if not self.player_name:
    self.player_name = "Detective"

If the user presses Enter without typing anything, .strip() returns an empty string, and the code sets the default name to "Detective". You can change "Detective" to any default name you prefer.

@BraydenPierce BraydenPierce deleted the copilot/create-adventure-story-game branch January 29, 2026 18:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants