Skip to content

Commit

Permalink
Merge pull request #6 from software-students-spring2024/hannah
Browse files Browse the repository at this point in the history
possible fix for testing issue, minor README changes, empty sample program
  • Loading branch information
nicjluz authored Mar 27, 2024
2 parents ce061c2 + 07c51ca commit c8ed4bf
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# New York Minute

New York Minute is a text-based game set in New York City. As a player, you choose your background and dream, and navigate through different locations in the city while making decisions to work, relax, network, and save your progress. The goal is to achieve your dream by gaining reputation points.
New York Minute is a text-based game set in New York City. As a player, you choose your background and dream, then navigate through different locations in the city while making decisions to work, relax, network, and save your progress. The goal is to achieve your dream by gaining reputation points.

## Installation

Expand Down Expand Up @@ -88,6 +88,9 @@ load_game("savegame.json", actions=['work', 'relax', 'network'])
### Playing the Game
During each turn, you will be presented with the current location and a random event. You can choose to work, relax, network, or save your progress. The game ends when you achieve your dream by gaining enough reputation points or when you complete all the locations.

### Sample Program
[Here](https://github.com/software-students-spring2024/3-python-package-exercise-namelessss/blob/main/example.py) is an example program using our Python package.

## Testing
To run tests for the New York Minute package in a pipenv, ensure you have pipenv installed. Then run `pipenv install` in a new testing directory.
After, run `pipenv shell` to activate the virtual environment. Now that we are in the virtual environment, run `pipenv install -i https://test.pypi.org/simple/ new-york-minute==0.2.0`
Expand All @@ -96,17 +99,19 @@ to download the new_york_minute package. Download the /tests directory from this
The -s flag allows capturing of stdout and stderr during the tests because this project is a console-based game.



## Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the [GitHub repository](https://github.com/software-students-spring2024/3-python-package-exercise-namelessss).

Contributing members are:
#### Contributing Team Members:
* [Hannah Horiuchi](https://github.com/hah8236)
* [Jiahua Liao](https://github.com/Jiahuita)
* [Kevin Lin](https://github.com/Kalados)
* [Nicole Luzuriaga](https://github.com/nicjluz)

## PyPi Page
[New York Minute](https://test.pypi.org/project/new-york-minute/0.2.0/) Package

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
Empty file added example.py
Empty file.
1 change: 1 addition & 0 deletions savegame.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name": "John", "dream": "Become a famous musician", "background": "Artist", "money": 1000, "reputation": 0, "stress_level": 0, "current_location": "Brooklyn", "inventory": []}
6 changes: 3 additions & 3 deletions src/new_york_minute/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ def network(self):
print("You attended a networking event and improved your reputation.")

@classmethod
def load_progress(cls):
if os.path.exists('savegame.json'):
with open('savegame.json', 'r') as f:
def load_progress(cls, save_file):
if os.path.exists(save_file):
with open(save_file, 'r') as f:
player_data = json.load(f)
player = cls(
player_data['name'],
Expand Down

0 comments on commit c8ed4bf

Please sign in to comment.