Created
November 27, 2015 18:55
-
-
Save jamie/997df5cdca8f01472df0 to your computer and use it in GitHub Desktop.
Some board analysis for Pandemic (and Pandemic Legacy).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pp' | |
def compute(paths) | |
out = [] | |
paths.keys.combination(3).each do |src| | |
next if src.include?(:atla) | |
next if src.include?(:hong) | |
next if src.include?(:cair) | |
next if src.include?(:saop) | |
seen = [src] | |
while seen.flatten.size < 48 | |
seen << seen.flatten.map{|k| paths[k]}.flatten.uniq - seen.flatten | |
end | |
next if seen.last.size > 7 | |
out << [seen.size-1, seen.first, seen.map(&:size)] | |
end | |
out.sort!.reject! { |dist, src, dest| dist > out.first.first} | |
pp out.sort | |
pp out.size | |
end | |
classic_paths = { | |
:algi => [:madr, :pari, :ista, :cair], | |
:atla => [:wash, :miam, :chic], | |
:bagh => [:tehr, :riya, :cair, :ista, :kara], | |
:bang => [:kolk, :hong, :hoch, :jaka, :chen], | |
:beij => [:seou, :shan], | |
:bogo => [:miam, :mexi, :lima, :buen, :saop], | |
:buen => [:saop, :bogo], | |
:cair => [:riya, :bagh, :ista, :algi, :khar], | |
:chen => [:jaka, :kolk, :delh, :mumb, :bang], | |
:chic => [:mont, :atla, :mexi, :losa, :sanf], | |
:delh => [:kolk, :chen, :mumb, :kara, :tehr], | |
:esse => [:stpe, :mila, :pari, :lond], | |
:hoch => [:hong, :bang, :jaka, :mani], | |
:hong => [:shan, :taip, :mani, :hoch, :bang, :kolk], | |
:ista => [:stpe, :mosc, :bagh, :cair, :algi, :mila], | |
:jaka => [:sydn, :hoch, :bang, :chen], | |
:joha => [:khar, :kins], | |
:kara => [:mumb, :delh, :tehr, :riya, :bagh], | |
:khar => [:cair, :lago, :kins, :joha], | |
:kins => [:lago, :khar, :joha], | |
:kolk => [:hong, :bang, :chen, :delh], | |
:lago => [:saop, :kins, :khar], | |
:lima => [:sant, :bogo, :mexi], | |
:lond => [:esse, :pari, :madr, :newy], | |
:losa => [:mexi, :chic, :sanf, :sydn], | |
:madr => [:saop, :newy, :lond, :pari, :algi], | |
:mani => [:losa, :sydn, :hoch, :hong, :taip], | |
:mexi => [:losa, :chic, :miam, :bogo, :lima], | |
:miam => [:wash, :atla, :mexi, :bogo], | |
:mila => [:ista, :pari, :esse], | |
:mont => [:newy, :wash, :chic], | |
:mosc => [:tehr, :ista, :stpe], | |
:mumb => [:chen, :delh, :kara], | |
:newy => [:lond, :madr, :wash, :mont], | |
:osak => [:toky, :taip], | |
:pari => [:mila, :esse, :lond, :madr, :algi], | |
:riya => [:kara, :bagh, :cair], | |
:sanf => [:chic, :losa, :mani, :toky], | |
:sant => [:lima], | |
:saop => [:buen, :bogo, :madr, :lago], | |
:seou => [:toky, :shan, :beij], | |
:shan => [:beij, :seou, :toky, :taip, :hong], | |
:stpe => [:mosc, :ista, :esse], | |
:sydn => [:losa, :mani, :jaka], | |
:taip => [:osak, :shan, :hong, :mani], | |
:tehr => [:delh, :kara, :bagh, :mosc], | |
:toky => [:sanf, :osak, :shan, :seou], | |
:wash => [:newy, :mont, :atla, :miam], | |
} | |
paths = { | |
:algi => [:madr, :pari, :ista, :cair], | |
:atla => [:wash, :miam, :chic], | |
:bagh => [:tehr, :riya, :cair, :ista], | |
:bang => [:kolk, :hong, :hoch, :jaka], | |
:beij => [:seou, :shan], | |
:bogo => [:miam, :mexi, :lima, :buen, :saop], | |
:buen => [:joha, :saop, :bogo, :sant], | |
:cair => [:riya, :bagh, :ista, :algi, :khar], | |
:chen => [:jaka, :kolk, :delh, :mumb], | |
:chic => [:mont, :atla, :mexi, :losa, :sanf], | |
:delh => [:kolk, :chen, :mumb, :kara, :tehr], | |
:esse => [:stpe, :mila, :pari, :lond], | |
:hoch => [:hong, :bang, :jaka, :mani], | |
:hong => [:shan, :taip, :mani, :hoch, :bang, :kolk], | |
:ista => [:stpe, :mosc, :bagh, :cair, :algi, :mila], | |
:jaka => [:sydn, :hoch, :bang, :chen], | |
:joha => [:khar, :kins, :buen], | |
:kara => [:mumb, :delh, :tehr, :riya], | |
:khar => [:cair, :lago, :kins, :joha], | |
:kins => [:lago, :khar, :joha], | |
:kolk => [:hong, :bang, :chen, :delh], | |
:lago => [:saop, :kins, :khar], | |
:lima => [:sant, :bogo, :mexi, :losa], | |
:lond => [:esse, :pari, :madr, :newy], | |
:losa => [:lima, :mexi, :chic, :sanf, :sydn], | |
:madr => [:saop, :newy, :lond, :pari, :algi], | |
:mani => [:losa, :sydn, :hoch, :hong, :taip], | |
:mexi => [:losa, :chic, :miam, :bogo, :lima], | |
:miam => [:wash, :atla, :mexi, :bogo], | |
:mila => [:ista, :pari, :esse], | |
:mont => [:newy, :wash, :chic], | |
:mosc => [:tehr, :ista, :stpe], | |
:mumb => [:chen, :delh, :kara], | |
:newy => [:lond, :madr, :wash, :mont], | |
:osak => [:toky, :taip], | |
:pari => [:mila, :esse, :lond, :madr, :algi], | |
:riya => [:kara, :bagh, :cair], | |
:sanf => [:chic, :losa, :mani, :toky], | |
:sant => [:buen, :lima], | |
:saop => [:buen, :bogo, :madr, :lago], | |
:seou => [:toky, :shan, :beij], | |
:shan => [:beij, :seou, :toky, :taip, :hong], | |
:stpe => [:mosc, :ista, :esse], | |
:sydn => [:losa, :mani, :jaka], | |
:taip => [:osak, :shan, :hong, :mani], | |
:tehr => [:delh, :kara, :bagh, :mosc], | |
:toky => [:sanf, :osak, :shan, :seou], | |
:wash => [:newy, :mont, :atla, :miam], | |
} | |
compute(paths) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
** Map changes between standard Pandemic and Legacy means this analysis is very different for both games. | |
Minimal coverage to put every city 3 steps away from a research station: | |
- Atlanta, Cairo, Manila | |
Minimal coverage to put almost every city 2 steps away from a research station: | |
- Atlanta, Hong Kong, Sao Paulo, Istanbul/Cairo: only 2 cities at three steps. | |
Other building types are not given the free Atlanta start, and can get reasonable coverage with just three stations: | |
- Cairo, Hong Kong, Mexico City: only 4 cities at three steps | |
- Cairo, Hong Kong, Miami: only 5 cities at three steps | |
Avoiding top cities for Research stations (so you don't lose both if city is lost): | |
- Algiers, Kolkata, Mexico City: only 7 cities at three steps | |
- Delhi, Madrid, San Francisco: only 7 cities at three steps |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment