dollarGame

command
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2025 License: MIT Imports: 4 Imported by: 0

README

The Dollar Game

The dollar game is a simple game of solitaire. Start with a connected graph where each vertex has some integer value (positive, negative, or zero). Attempt to make all vertices non-negative by repeatedly applying either of these steps:

  • A given node requests aid. Each adjacent node gives it one dollar.
  • A given node offers aid. It gives each adjacent node one dollar.

Once all nodes have non-zero values the game is won.

Running the Game

go run dollarGame.go | gvpack -u | dot -Tpng > test.png && open test.png

Play Notes

Not all starting configurations are solvable. If the following inequality is true then the configuration will be solvable (it is not clear whether the converse is true):

Total of all values >= EdgeCount - VertexCount + 1

Resources

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL