LockerGnomeTech news and nostalgia for today's technology professionals
Subscribe

Search

Retro

Asked to Rig Royal McBee's Blackjack Demo for Sales, Mel Kaye Got the Cheat Backwards

Ed Nather's firsthand account has a second act, in which the colleague assigned to repair Mel's work finds a reason to stop looking.

A retro comic-style illustration of Chris in glasses and a cream shirt at a green felt card table, shrugging with an open palm as he glances sideways, with a weak two and three in front of him, an ace and king across the table, a stack of red chips and a chrome toggle switch with a red light on the table rail.
Illustration: LockerGnome

Royal McBee’s sales department had a problem with its blackjack demo: customers sometimes lost. The salesmen considered this too fair (a true sales emergency) and filed a change request. They wanted a sense switch on the console that would tilt the odds and let the prospect win.

Mel balked. Ed Nather, who worked with him, wrote that Mel “felt this was patently dishonest, which it was.” The Head Salesman talked to him. So did the Big Boss and, at the boss’s urging, a few fellow programmers. Mel finally wrote the code, with the test reversed. Flip the switch and the machine cheated in its own favor, every single hand.

Nather’s account says Mel was delighted, “claiming his subconscious was uncontrollably ethical, and adamantly refused to fix it.”

The demo had a reputation to lose. Mel had written the original in hexadecimal for the LGP-30, a small drum-memory computer, and it played prospects at computer shows. Nather remembered a packed booth while IBM’s salesmen stood around talking to each other. Whether it sold any computers “was a question we never discussed” (very sales, much metrics).

The rigging request arrived after Mel rewrote the game for the newer RPC-4000. Each instruction on that machine also named where on the spinning drum to find the next one. Mel placed instructions by hand so the next would reach the read head just as the machine was ready for it. He skipped the optimizing assembler and still beat it on speed. He was literally marching to the beat of his own drum.

He also had views. “If a program can’t rewrite its own code,” Mel asked, “what good is it?”

After Mel left the company, the Big Boss asked Nather to find the backwards test and reverse it. Nather reluctantly agreed and went digging. Along the way came a loop with no test in it at all. By common sense it should have run forever, yet program control passed straight through and out the other side.

Nather needed two weeks to crack it. Mel’s loop changed the address inside one of its own instructions on each pass. He had parked the data near the top of memory, so after the last item, adding one overflowed the address. The carry spilled into the operation code and turned the instruction into a jump. The program hopped to the next step, waiting at address zero. The overflow was the exit door.

That discovery ended the repair job. Nather quit looking for the cheat and told the Big Boss they couldn’t find it. The boss didn’t seem surprised.

Nather posted the story to Usenet on May 21, 1983. It was written as straight prose, and a 1992 postscript says it later turned into free verse as it bounced around the net. Nather liked that version better. A 1999 update on the same page connects Mel to a last name, citing an LGP-30 manual that credits “Mel Kaye of Royal McBee” with the bulk of the programming of the ACT 1 system.

The next change request

Expect the sales-department version of this to keep showing up wherever a demo has to impress someone on cue. A switch that changes how software behaves for an audience is cheap to ask for, and the pressure lands on whoever has to type it. A fair bet is that the paper trail will matter more than the programmer’s subconscious. A reviewed change leaves a second person staring at that backwards test, probably before the trade show.

Mel’s version had no such luck, and Nather was fine with that. “When I left the company, the blackjack program would still cheat if you turned on the right sense switch,” Nather wrote, “and I think that’s how it should be.”

Sales got its switch. The house won.

More Retro

Every Retro story →