Installing the Program

Unzip the file GOPS.ZIP. This will place the following in your current directory: At the moment, there is no clever icon available for this program.

If you are running on DOS, the program will not run properly unless you have the line

in your CONFIG.SYS file.

WIth the OS/2 version, you merely need to see that you do not have

Of course, ANSI ON is all right.

NOTE: The program writes a log file GOPS.LOG in your working directory whenever you play the game. This takes up about 350 bytes per game, recording everything that happens. The idea is that someday people may might send some of these back to me, providing data on how the game does against different players. At the moment there is no way to turn off the logging, but there is no harm in deleting the file.

The Idea of the Game

We separate the suits in a standard deck of cards. You get one suit; I get one; one is shuffled and laid out face up in the middle of the table; the fourth suit is put aside.

The top card on the table is the stake we play for, with a value from 1 to 13. We each select a card to play. We show them at the same time, and the higher card gets the stake. Then we play the same way for the next card on the table, and so on. In case of a tie, the card stays on the table; then we play for it and the next card together.

In some cases, especially late in a game, the best strategy may depend on whether you are trying to maximize your score or to get a majority of the 91 available points. The program always tries to maximize points, as if it were playing gin rummy for a penny a point, not settling a winner-take-all poker hand.

Playing the Game

Invoke GOPS from the command line or a progam object or whatever. Don't put anything else on the command line unless you want to explore undocumented options. Under OS/2 the program runs in a text window; naturally, you can play either the OS/2 or the DOS version. There's no reason you couldn't run the DOS version under Windows, but that option isn't tested as part of my QA procedure.

If the screen is a mess when you start the program, you probably don't have ANSI display controls enabled; see above. Otherwise, you will see something like

You: 0
Me:  0

Up card: 12   Rest of the deck:  13  1  7  6  2  5 10  8  9  4  3 11

Yours:   1  2  3  4  5  6  7  8  9 10 11 12 13
Mine:    1  2  3  4  5  6  7  8  9 10 11 12 13

What do you play?

The value shown as "Up card" is the stake: 12 points in this case. The rest of the deck is laid out face up because it's important information, and this game is predicated on both players knowing everything except what the other player is planning to play. Under "Yours" and "Mine" are the cards remaining in each player's hand.

Type the number of the card you want to play. The program will update the display to show the cards played, the new score, and so on.

Does the computer cheat?

No. Obviously it could look at your choice, then play either the next higher card or some very low card, but it doesn't. Some day when I want to bone up on zero-knowledge proofs, I may put in code to prove that it's not cheating; meanwhile, you can trust me on this or just not play the game.

Game Theory

Gad, sir, Lord [Somebody] is right! We must build a bigger navy than the enemy
will build when he hears we're building a bigger navy than he's building!
                                                           --Colonel Blimp
If you try figure out your next GOPS move in the most obvious way, you quickly get into a Blimpian problem: "If he does this, then I should do that, but if I do that then he'll do alpha instead, and I'll have to do beta instead of that, and he'll do gamma and..." and so on forever. By contrast, you really could use that kind of analysis to get a complete solution to games such as tic-tac-toe (naughts and crosses) or chess, if you just had a fast enough computer. The difference is that in classic board games you know exactly what the situation is and what it will be after you make any selected move; whereas in GOPS you don't know the situation after your next move, because it depends on the move that the other player makes at the same time.

There is a solution to a two-person zero-sum game of imperfect information, such as GOPS; but it generally involves randomizing your plays. The theory of these games tells how to assign probabilities to all your possible moves so that the solution is stable. That is, you can give the opponent the list of probabilities you're going to use in selecting a card (not, of course, the particular card you've selected); the opponent can do the same; and when you've looked at each other's strategies, neither of you can get an advantage by changing strategy.

That one can solve these games with such precision is pretty amazing. So amazing that it led a lot of wise fools astray back when we were computing how to fight the Evil Empire.

The RAND Corporation's the hope of the world,
They think all day long for a fee.
They sit and play games about about going up in flames;
For counters they use you and me.
              --Malvina Reynolds

Political note: anybody who tries to analyze nuclear politics in terms of zero-sum games (what you lose, I gain) is clearly acting like an idiot. But you see, there was no theory of non-zero-sum games at the time, so they did what they could. Otherwise, what would have happened to their grants? In a proof that there is justice in the universe, the first successful approach to winning non-zero-sum games (we may both win or both lose) was an incredibly simple rule proposed by Anatol Rapoport, who had been the most persistent and coherent critic of RAND-style analyses. But I digress.

The problem with GOPS is that, like chess, it's too big to allow a complete solution in real time. (note) So we attempt a good enough solution by trying to approximate the values of future positions instead of working them out fully. This, of course, is what chess programs do, though with completely different methods due to the different nature of the game.

The point of writing this program, then, was to play with approximation methods. I'd be interested in anyone's reactions to its quality of play and its weaknesses. To encourage objectivity, I'm not saying anything just yet about the methods it uses.

(note)Actually, I haven't worked out what you could do to GOPS with a Cray; but since difficulty grows with n factorial squared, or maybe more, it wouldn't take a very large deck to make the problem intractable.
Date last modified: July 12, 2001
Dan Drake's Home Page
Mail to

Copyright (C) 1997 Daniel Drake. A royalty-free license to reproduce this document in whole or in part is hereby granted provided (i) all additions, omissions, and other changes are clearly marked; (ii) the work is not reproduced as, or as part of, a work for which payment is charged; (iii) this notice is reproduced without change. Quotations for critical or polemical purposes, with proper attribution, are permitted in any case, being obviously fair use.