  Nonlocal games yield an unusual perspective on entangled quantum states. The
defining property of such games is that a set of players in joint possession of
an entangled state can win the game with higher probability than is allowed by
classical physics. Here we construct a nonlocal game that can be won with
certainty by $2N$ players if they have access to the ground state of the toric
code on as many qubits. By contrast, the game cannot be won by classical
players more than half the time in the large $N$ limit. Our game differs from
previous examples because it arranges the players on a lattice and allows them
to carry out quantum operations in teams, whose composition is dynamically
specified. This is natural when seeking to characterize the degree of
quantumness of non-trivial many-body states, which potentially include states
in much more varied phases of matter than the toric code. We present
generalizations of the toric code game to states with $\mathbb{Z}_M$
topological order.
