Skip to content

[013] Solution SX2Y2#76

Open
Ilia Alenabi (iliall) wants to merge 1 commit into
mainfrom
task-013/sol-SX2Y2
Open

[013] Solution SX2Y2#76
Ilia Alenabi (iliall) wants to merge 1 commit into
mainfrom
task-013/sol-SX2Y2

Conversation

@iliall

Copy link
Copy Markdown
Collaborator

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 SX2Y2 for issue #13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant