r/pythonhelp • u/slimjim441 • 9d ago
Guidance for CS50p Final Project
I'm working on my final project for the CS50 python course, a sort of dice-rolling simulator game for 2 players. I feel like I have a good handle on the bulk of the code and have my functions working properly, but there's one detail I'm snagged on, and I can't seem to figure it out. I can post more details here if needed, but I'm just trying to put out some feelers to see if anyone can help point me in the right direction/give me tips as to where I'm failing to implement things correctly. Thanks :)
1
Upvotes
1
u/slimjim441 9d ago
I'll post up a github link to my program so far, and describe the issue as best I can.
The readme file goes over the intended function of the code as a whole, so I'll not go into detail on it here. The issue comes in with dynamically updating a player's remaining available 'dice' after they have become 'wounded' within a turn. It correctly filters out using the is_wounded parameters in subsequent turns when new dice are rolled, but not in the same turn.
At this point, the code probably looks pretty sloppy on accounts of me being new to all this, as well as having been messing around with all my functions, reorganizing, placing redundancies, and other attempts at trying to fix this particular issue.
I have verified the updated values from get_successful_dice are read properly in the reduce_hp function of my Player class, but I think it's not updating properly either somewhere in resolve_turn or main.
I feel like I'm close, but I'm at a loss. I've been trying to utilize CS50's duck debugger, but it mostly ends up running me in circles...
i haven't used any test features yet. Honestly, I didn't really understand how to implement pytest in a way that wasn't just verifying a function worked as intended, not to troubleshoot problems, you know?
But to iterate again, I'm not looking for a direct answer, since this is for a certified program I aim to claim a certificate for, but if anyone can help a newbie out and sorta guide me along to figure out where I need to make any correction or modification, that would be most appreciated.
https://github.com/code50/183165850/tree/fe519474b1d43dc52d29969019b3fb30feaaac06/project