Skip to content

Added coup #114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Added coup #114

wants to merge 3 commits into from

Conversation

YVin3D
Copy link

@YVin3D YVin3D commented Jun 11, 2025

Description

Adds Coup the board game.

Motivation and Context

I like Coup.

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New game (adds a new game to TextArena)
  • Game enhancement (improves an existing game)
  • New feature (non-breaking change which adds core functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (update in the documentation)
  • Refactoring (code improvement without changing functionality)

Game-specific changes

If your PR adds or modifies a game, please specify:

Adds Coup with good documentation for the code as well as implementation. Commented code so it should be easy to follow. Please see the README.md in textarena/envs/Coup for more.

Implementation Details

  • Basic Play and Prompting
  • Ability for other players to block/bullshit
  • Ability for other players to bullshit a blocker
  • Board and state rendering
  • end-to-end game works with two players
  • [?] end-to-end game works with >2 players

Notes:

  • I can't seem to get >2-players to work consistently. It does work... most of the time. On rare occasions it just runs on for an entire game's worth of prompts without ever hitting a breakpoint in the step() function. I think it has something to do with it maxing out on invalid moves. I gave up trying to debug I'm sorry. This code is otherwise functional, though.

Testing

Describe the tests you've done to verify your changes. For game-specific changes, describe how you've tested the game mechanics.

  • reasoning models
  • non-reasoning models
  • exchange and keep end-to-end
  • you still lose your coins if your assassination is blocked
  • fake block an assassination with 2 cards remaining (double hit, insta-eliminate)
  • fake block an assassination with 1 cards remaining (double hit, but shouldn't crash)
  • incorrect block ([block foreign aid] when last played was a tax)
  • two players end-to-end
  • three players end-to-end
  • four players end-to-end
  • five players end-to-end
  • six players end-to-end
  • invalid steal target player ([steal 7])
  • target player on a steal doesn't have enough coins
  • invalid coup
  • recovery from invalid move
  • forces a coup when coins >=10

Checklist

Go over all the following points, and put an x in all the boxes that apply.
If you are unsure about any of these, don't hesitate to ask. We are here to help!

  • I have read the contribution guidelines. (required)
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes. (required for bug fixes or new features)
  • All new and existing tests passed.
  • For game changes, I have verified that the game still runs correctly end-to-end.

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