[013] Solution SX2Y2#76
Open
Ilia Alenabi (iliall) wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Agent-Generated Summary
Implemented a complete Mafia Game MVP backend service with Flask HTTP API. The service includes: 1) Lobby management with player join/leave, name validation (3-20 chars, alphanumeric with spaces/hyphens/underscores), case-insensitive uniqueness, and lobby locking during games. 2) Game start with any player becoming Game Starter, random role assignment (mafia count = max(1, floor(N/3))), and private role retrieval where mafia see teammates. 3) Day phase with alive player voting, self-votes allowed, public vote counts, majority threshold = floor(alive/2)+1, and immediate day end on majority. 4) Night phase with mafia-only voting for alive citizens, aggregated vote visibility for mafia, majority threshold = floor(alive_mafia/2)+1, and unique-highest-vote resolution on manual end. 5) Win conditions checked after eliminations (citizens win when all mafia eliminated, mafia win when mafia >= citizens). The API exposes all functionality through REST endpoints and the lobby reopens immediately when games end.
Completion time: ~659 seconds
This pull request is solution
SX2Y2for issue #13.