t4t_games/
lib.rs

1#![warn(missing_docs)]
2
3//! This library provides example games and strategies implemented using the
4//! [tit-for-tat (t4t)][t4t] library.
5//!
6//! The games are organized into modules, which define several related games and strategies for
7//! playing them. The top-level documentation for each module provides a more detailed overview.
8//!
9//! # Dilemma games ([dilemma])
10//!
11//! This module defines a collection of 2x2 symmetric normal-form games, where each player may
12//! cooperate or defect. It includes the classic [prisoner's dilemma][prisoner] game, along with
13//! several related games such as [stag hunt][stag-hunt], [chicken][chicken], and more!
14//!
15//! The games in this module are typically played [repeated][repeated] several times, with the
16//! payoffs accumulated.
17//!
18//! The module also includes [several well-known strategies][pd-strategies] for playing the
19//! repeated forms of such games, including the famous [tit-for-tat strategy][tft-strategy] from
20//! which the t4t library gets its name!
21//!
22//! # Rock-paper-scissors games ([rock_paper_scissors])
23//!
24//! This module defines [rock-paper-scissors][rps-game] plus a few variants of the classic game
25//! that involve either more moves or more players.
26//!
27//! In particular, this module illustrates a very large variant of rock-paper-scissors involving
28//! 100 players playing simultaneously, which is supported by t4t's normal form representation that
29//! does not require representing the payoff matrix directly.
30//!
31//! # Tic-tac-toe ([tic_tac_toe])
32//!
33//! This module defines [tic-tac-toe][tic-tac-toe-game], illustrating how combinatorial games can
34//! be defined by defining the game's state and describing the moves each player may make to modify
35//! that state.
36//!
37//! The example in the module also illustrates t4t's built-in generic minimax strategy, which can
38//! play small combinatorial games optimally.
39//!
40//! [t4t]: https://crates.io/crates/t4t
41//! [prisoner]: https://en.wikipedia.org/wiki/Prisoner%27s_dilemma
42//! [stag-hunt]: https://en.wikipedia.org/wiki/Stag_hunt
43//! [chicken]: https://en.wikipedia.org/wiki/Chicken_(game)
44//! [repeated]: https://en.wikipedia.org/wiki/Repeated_game
45//! [pd-strategies]: http://www.prisoners-dilemma.com/common-strategy/
46//! [tft-strategy]: https://en.wikipedia.org/wiki/Tit_for_tat
47//! [rps-game]: https://en.wikipedia.org/wiki/Rock_paper_scissors
48//! [tic-tac-toe-game]: https://en.wikipedia.org/wiki/Tic-tac-toe
49
50pub mod dilemma;
51pub mod rock_paper_scissors;
52pub mod tic_tac_toe;