Skip to content

neu-cs2000/f25-lab10-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Lab 10 Starter: Choose-Your-Own-Adventure with AI

This is the starter code for Lab 10. Complete the three functions marked with # TODO to make the game work.

Files

  • adventure_game.py - Main game file with data structures and partial implementation
  • requirements.txt - Python dependencies
  • README.md - This file

Setup

Install Dependencies

pip install -r requirements.txt

Play the Game

Once you've implemented the required functions, you can play:

python adventure_game.py

Your Tasks

You need to complete these three functions in adventure_game.py:

  1. message_to_story_chunk(message: List[str]) -> StoryChunk

    • Parse server messages into StoryChunk objects
    • Handle edge cases like empty messages
  2. integrate_message(world: GameWorld, message: List[str]) -> GameWorld

    • Add new story chunks to the front of the story list
    • Set waiting to False
  3. request_next_chunk(world: GameWorld, choice_num: int) -> Tuple[GameWorld, str]

    • Process user choices and prepare server messages
    • Add choice confirmation to story and set waiting to True

Game Controls

  • Enter a number (0, 1, 2, etc.) to make a choice
  • Type 'quit' to exit

Server Configuration

By default, the game uses mock responses for testing. To connect to the real AI server:

  1. Get the server URL and API key from your TA
  2. Edit the constants at the top of adventure_game.py:
# Server Configuration
SERVER_URL = "https://your-lab-server.com"  # Base URL (from TA)
API_KEY = "some-secret-key"          # From TA

Interpretive Question

Answer the interpretive question about AI-generated content risks at the bottom of adventure_game.py.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages