#game-theory #evolution #economics

t4t-games

A library of games and strategies built with t4t

8 releases

0.2.1 Oct 8, 2024
0.2.0 Sep 17, 2024
0.1.1 Jul 14, 2024
0.1.0 May 31, 2024
0.0.2 Apr 28, 2024

#164 in Simulation

Download history 130/week @ 2024-09-12 33/week @ 2024-09-19 21/week @ 2024-09-26 146/week @ 2024-10-03 37/week @ 2024-10-10

562 downloads per month

MIT license

285KB
4K SLoC

Tit-for-tat games (t4t-games)

GitHub crates.io docs.rs/t4t-games GitHub actions workflow status

A library of games and strategies implemented with the t4t library.

See the top-level documentation for an overview of the included games and strategies.


lib.rs:

This library provides example games and strategies implemented using the tit-for-tat (t4t) library.

The games are organized into modules, which define several related games and strategies for playing them. The top-level documentation for each module provides a more detailed overview.

Dilemma games ([dilemma])

This module defines a collection of 2x2 symmetric normal-form games, where each player may cooperate or defect. It includes the classic prisoner's dilemma game, along with several related games such as stag hunt, chicken, and more!

The games in this module are typically played repeated several times, with the payoffs accumulated.

The module also includes several well-known strategies for playing the repeated forms of such games, including the famous tit-for-tat strategy from which the t4t library gets its name!

Rock-paper-scissors games ([rock_paper_scissors])

This module defines rock-paper-scissors plus a few variants of the classic game that involve either more moves or more players.

In particular, this module illustrates a very large variant of rock-paper-scissors involving 100 players playing simultaneously, which is supported by t4t's normal form representation that does not require representing the payoff matrix directly.

Tic-tac-toe ([tic_tac_toe])

This module defines tic-tac-toe, illustrating how combinatorial games can be defined by defining the game's state and describing the moves each player may make to modify that state.

The example in the module also illustrates t4t's built-in generic minimax strategy, which can play small combinatorial games optimally.

Dependencies

~5MB
~105K SLoC