|
|
You can make a dinner by passing a permutation to Dinner(). You won't use this one, so don't worry about it.
An ethiopian Dinner having 4 morsels: {(4, 2), (1, 3), (3, 1), (2, 4)}
An ethiopian Dinner having 4 morsels: {(4, 2), (1, 3), (3, 1), (2, 4)}
|
You can make a dinner by passing a set of pairs to Dinner().
An ethiopian Dinner having 7 morsels: {(7, 3), (6, 7), (4, 6), (1, 5),
(3, 4), (5, 2), (2, 1)}
An ethiopian Dinner having 7 morsels: {(7, 3), (6, 7), (4, 6), (1, 5), (3, 4), (5, 2), (2, 1)}
|
You can make a random dinner by inputting just the number of morsels you desire.
An ethiopian Dinner having 5 morsels: {(4, 5), (5, 1), (3, 3), (1, 4),
(2, 2)}
An ethiopian Dinner having 5 morsels: {(4, 5), (5, 1), (3, 3), (1, 4), (2, 2)}
|
You can check on the size of the dinner and its morsels.
False False |
True True |
{(7, 3), (6, 7), (4, 6), (1, 5), (3, 4), (5, 2), (2, 1)}
{(7, 3), (6, 7), (4, 6), (1, 5), (3, 4), (5, 2), (2, 1)}
|
7 7 |
You can ask for the next move according to crossout.
(6, 7) (6, 7) |
You can obtain a list of all attainable scores for the dinner. This is cached so it only takes a long time the first time you call it for a given dinner.
{(11, 16), (15, 13), (8, 13), (12, 14), (10, 19), (14, 13), (10, 15),
(10, 21), (6, 18), (14, 15), (12, 16), (15, 19), (11, 19), (14, 22),
(16, 17), (11, 10), (12, 20), (9, 15), (16, 14), (10, 12), (8, 20), (18,
16), (13, 18), (9, 17), (17, 12), (7, 16), (15, 17), (13, 11)}
{(11, 16), (15, 13), (8, 13), (12, 14), (10, 19), (14, 13), (10, 15), (10, 21), (6, 18), (14, 15), (12, 16), (15, 19), (11, 19), (14, 22), (16, 17), (11, 10), (12, 20), (9, 15), (16, 14), (10, 12), (8, 20), (18, 16), (13, 18), (9, 17), (17, 12), (7, 16), (15, 17), (13, 11)}
|
You can debug and see what it's doing for the more complicated functions by adding in "verbose=True".
game is {(7, 3), (6, 7), (4, 6), (1, 5), (3, 4), (5, 2), (2, 1)}
alice crossed (1, 5) game is {(7, 3), (6, 7), (4, 6), (3, 4), (5, 2),
(2, 1)}
bob crossed (2, 1) game is {(3, 4), (7, 3), (5, 2), (6, 7), (4, 6)}
game is {(3, 4), (7, 3), (5, 2), (6, 7), (4, 6)}
alice crossed (3, 4) game is {(7, 3), (5, 2), (4, 6), (6, 7)}
bob crossed (5, 2) game is {(7, 3), (6, 7), (4, 6)}
game is {(7, 3), (6, 7), (4, 6)}
alice crossed (4, 6) game is {(7, 3), (6, 7)}
bob crossed (7, 3) game is {(6, 7)}
game is {(6, 7)}
alice crossed (6, 7) game is {}
(6, 7)
game is {(7, 3), (6, 7), (4, 6), (1, 5), (3, 4), (5, 2), (2, 1)}
alice crossed (1, 5) game is {(7, 3), (6, 7), (4, 6), (3, 4), (5, 2), (2, 1)}
bob crossed (2, 1) game is {(3, 4), (7, 3), (5, 2), (6, 7), (4, 6)}
game is {(3, 4), (7, 3), (5, 2), (6, 7), (4, 6)}
alice crossed (3, 4) game is {(7, 3), (5, 2), (4, 6), (6, 7)}
bob crossed (5, 2) game is {(7, 3), (6, 7), (4, 6)}
game is {(7, 3), (6, 7), (4, 6)}
alice crossed (4, 6) game is {(7, 3), (6, 7)}
bob crossed (7, 3) game is {(6, 7)}
game is {(6, 7)}
alice crossed (6, 7) game is {}
(6, 7)
|
Subset {(4, 2), (1, 3)} has score [5, 5]
Subset {(4, 2), (3, 1)} has score [7, 7]
Subset {(4, 2), (2, 4)} has score [6, 4]
Subset {(1, 3), (3, 1)} has score [4, 6]
Subset {(1, 3), (2, 4)} has score [3, 3]
Subset {(3, 1), (2, 4)} has score [5, 5]
{(7, 7), (6, 4), (3, 3), (4, 6), (5, 5)}
Subset {(4, 2), (1, 3)} has score [5, 5]
Subset {(4, 2), (3, 1)} has score [7, 7]
Subset {(4, 2), (2, 4)} has score [6, 4]
Subset {(1, 3), (3, 1)} has score [4, 6]
Subset {(1, 3), (2, 4)} has score [3, 3]
Subset {(3, 1), (2, 4)} has score [5, 5]
{(7, 7), (6, 4), (3, 3), (4, 6), (5, 5)}
|
This will show a pretty picture of the attainable scores.
{(7, 3), (6, 7), (4, 6), (1, 5), (3, 4), (5, 2), (2, 1)}
{(7, 3), (6, 7), (4, 6), (1, 5), (3, 4), (5, 2), (2, 1)}
|
You can compute the scores attainable in matchups against Crossout.
{(16, 17), (15, 13), (12, 14), (13, 18), (18, 16), (14, 15), (13, 11),
(17, 12), (15, 19), (16, 14), (14, 22), (15, 17)}
{(16, 17), (15, 13), (12, 14), (13, 18), (18, 16), (14, 15), (13, 11), (17, 12), (15, 19), (16, 14), (14, 22), (15, 17)}
|
{(11, 16), (12, 20), (8, 13), (10, 19), (8, 20), (10, 15), (10, 21), (6,
18), (13, 18), (9, 17), (7, 16), (11, 19), (14, 22)}
{(11, 16), (12, 20), (8, 13), (10, 19), (8, 20), (10, 15), (10, 21), (6, 18), (13, 18), (9, 17), (7, 16), (11, 19), (14, 22)}
|
The command show_all() will compute all the scores, and show them, colour-coded by whether they can be attained by matchups against Crossout. The crossout-crossout matchup is always in red. Black is not attainable by any matchup against Crossout. Orange is attainable if Bob plays Alice's crossout. Blue-green is attainable if Alice plays Bob's crossout. And the brownish ones (a blend of orange and blue-green) are attainable in both these ways.
{(7, 3), (6, 7), (4, 6), (1, 5), (3, 4), (5, 2), (2, 1)}
{(7, 3), (6, 7), (4, 6), (1, 5), (3, 4), (5, 2), (2, 1)}
|
You can check if Crossout for a given game is Pareto optimal, weakly Pareto optimal, or a Nash equilibrium.
True True |
True True |
True True |
Here are some bigger examples of games.
{(2, 16), (10, 11), (14, 13), (6, 2), (1, 6), (11, 4), (15, 14), (8, 5),
(3, 3), (4, 15), (5, 7), (16, 1), (7, 10), (13, 9), (9, 12), (12, 8)}
{(2, 16), (10, 11), (14, 13), (6, 2), (1, 6), (11, 4), (15, 14), (8, 5), (3, 3), (4, 15), (5, 7), (16, 1), (7, 10), (13, 9), (9, 12), (12, 8)}
|
{(6, 4), (7, 1), (5, 7), (1, 8), (2, 3), (4, 2), (8, 6), (3, 5)}
{(6, 4), (7, 1), (5, 7), (1, 8), (2, 3), (4, 2), (8, 6), (3, 5)}
|
{(6, 4), (1, 3), (4, 9), (5, 7), (2, 1), (8, 8), (9, 6), (7, 2), (3, 5)}
{(6, 4), (1, 3), (4, 9), (5, 7), (2, 1), (8, 8), (9, 6), (7, 2), (3, 5)}
|
{(10, 5), (5, 7), (3, 3), (7, 6), (6, 10), (2, 1), (8, 8), (1, 9), (9,
4), (4, 2)}
{(10, 5), (5, 7), (3, 3), (7, 6), (6, 10), (2, 1), (8, 8), (1, 9), (9, 4), (4, 2)}
|
{(4, 10), (5, 4), (6, 11), (12, 12), (7, 7), (11, 3), (8, 8), (2, 2),
(9, 6), (1, 1), (10, 9), (3, 5)}
{(4, 10), (5, 4), (6, 11), (12, 12), (7, 7), (11, 3), (8, 8), (2, 2), (9, 6), (1, 1), (10, 9), (3, 5)}
|
There are a few global functions for checking various things over all games of a given size.
'Done' 'Done' 'Done' 'Done' 'Done' 'Done' 'Done' 'Done' 'Done' 'Done' |
'Done' 'Done' 'Done' 'Done' 'Done' 'Done' 'Done' 'Done' 'Done' 'Done' |
'Done' 'Done' 'Done' 'Done' 'Done' 'Done' 'Done' 'Done' 'Done' 'Done' |
An ethiopian Dinner having 6 morsels: {(1, 5), (5, 4), (4, 3), (6, 6),
(3, 2), (2, 1)}
An ethiopian Dinner having 6 morsels: {(6, 3), (1, 5), (3, 2), (5, 6),
(4, 4), (2, 1)}
'Done'
An ethiopian Dinner having 6 morsels: {(1, 5), (5, 4), (4, 3), (6, 6), (3, 2), (2, 1)}
An ethiopian Dinner having 6 morsels: {(6, 3), (1, 5), (3, 2), (5, 6), (4, 4), (2, 1)}
'Done'
|
'Done' 'Done' |
'Done' 'Done' |
Now you can play around yourself. Please find bugs!
|
|