This is an idea I've been throwing around in my head for the last couple of days, but finally got around to actually implementing in code today. I am now ready to subject the world to my terrible programming skills.
I suspect most computer users will be familiar with the game of minesweeper - it really isn't all that complex by itself. However, I've added a little twist to it. The idea is the following:
- Mines and people are randomly distributed across the minefield.
- The player can only detect mines, not people.
- The player can stop searching for mines at any time she/he desires.
- If the player opens a cell with a mine, all mines detonate.
- If the player stops searching, only the non-flagged mines detonate.
- Once the game ends, every person in an explosion or next to one dies.
- Every survivor contributes 10 pleasure.
- Every death contributes 10 pain.
- For every death, every survivor contributes 0.05 pain.
- There are 480 cells, 250 people and 99 mines.
- Your goal, should you choose to embrace it, is to maximise the pleasure/pain ratio.
That is all. The values I chose arbitrarily, but right now I feel it's pretty balanced. Once you flag around a third of the mines, the ratio starts rising considerably, but there is always an element of chance. If you hit a mine on your first try (or quit immediately), around 80% of the people will die on average.
SYSTEM REQUIREMENTS: Python 2.7, ncurses.
Update #1: Implemented JushuaZ's idea - if you flag an empty cell, all your flags are disregarded.
Update #2: Fixed bug spotted by DanielLC