Skip to content

RiesBen/GameThePy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GameThePy fancy logo

GameThePy

A GameTheory library in it's making

Example

Simple games

# Imports 
from gamethepy import Game
from gamethepy import RandomStrategyPlayer
from gamethepy.normal_form_games import PrisonersDilemmaGame

# Build the Game
players = [RandomStrategyPlayer() for _ in range(2)]
rules = PrisonersDilemmaGame()
game = Game(players=players, metric=rules)

# Play
results = game.turns(10)

# Outcome
results

Result - Output:

PlayerA PlayerB
Turn
0 2 -1
1 1 1
2 -2 -2
3 -1 2
4 2 -1
5 1 1
6 2 -1
7 -2 -2
8 -2 -2
9 -2 -2

About

A GameTheory library in it's making

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages