Skip to content

[MAINT] Refactor implementation of normal form game formatter #840

@tturocy

Description

@tturocy

The file src/games/writer.cc implements two functions which render normal form games: WriteHTMLFile and WriteLaTeXFile.

A quick inspection of these shows that actually the logic of these is the same. These functions create a series of tables, where each table is the projection of the game defined by fixing the strategies of all players except two of them, and then generating the table by considering all pairs of strategies of the free players.

It would be useful to refactor this so that the logic of iterating and projecting is written just one time. This would enable consistency between the two output formats we have now - as well as making it more straightforward to add additional output formats in future (for example, one could imagine Markdown tables).

Metadata

Metadata

Labels

c++Items which involve writing in C++

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions