A sign advertising roulette against a blue sky

Terminal Roulette is a classic casino game in your terminal

David Rutland
David Rutland Terminal

Ah! The bright lights of Vegas, the complementary drinks, and attractive people of the appropriate gender gasping, as you boldly bet it all on black. What is there not to like about roulette?

Well there are a few things, not least of which is that if you stay on the table all night, you're likely to lose everything, take out a line of credit, and end up digging your own grave while being watched by a family of scorpions in the desert sun.

Aside from that, roulette is pretty cool. It's not just a game of chance - you could get that with a random number generator - there's the fascination of watching the machinery in motion, and the numbers flashing up. There's the anticipation as you wait for it to settle.

While we'd love to go to Vegas and risk everything on a silver ball, we're not going to - chained as we are to this keyboard, and reluctant to brave a trip to the airport.

Why play roulette in the Linux terminal?

A roulette wheel with the ball settled on 25

If we believe what we're told by the gambling industry, betting on random events and sporting fixtures is something you should do for entertainment. Not something you should do if you can't afford to lose the money. A glance at the weeping and broken figures exiting our local dens of inquity tells us this advice is seldom heeded.

We're pretty broke to start with, and can guarantee that if we set up a betting account online, we'd be poorer still. Sure, gambling sites are flashy, and there are all kinds of offers, but we know who's going to come out better off at the end of the day - and it isn't us.

Far better to play roulette locally, offline, with complementary beers from the kitchen fridge, and a stackful of imaginary money that you can regenerate at any time. Since we spend most of our waking hours in the terminal anyway, terminalroulette, by Canadian techie Lev Kushtym, seems like the better option.

How to install terminalroulette

terminal roulette is a doddle to get onto your system, requiring only that you have git and Python already installed.

if you have those prerequisites, clone the terminalroulette repository with:

git clone https://github.com/levkush/terminalroulette.git

Use the cd command to move into the new directory:

cd terminalroulette

...and launch the game with:

python3 roulette.py

Spin the roulette wheel in your terminal!

terminal approximation of a roulette board and roulette wheel having lost $250

You start the game with a $1,000 balance and a representation of a roulette table at the top of your terminal. If you're familiar with the game, you'll recognise the green zeroes, and the long rows of numbered black and red squares.

Below this is a representation of the wheel itself. It's not round but instead, shows a seven-number segment. When the game starts, the indicator is set on zero.

As you might expect from a TUI game, the action is text-driven. With the action of betting following this pattern:

bet amount outcome

So if you wanted to place $250 of your imaginary cash on the number 27, you'd enter:

bet 250 27

Hit enter and you'll see "Successfully bet 250$ on 27!" From here, there's no way back, so type

 start

...and type enter once more to set the game in motion.

Your ballance will dip by $250, and the wheel representation will flash into a semblence of motion as colours and numbers jockey for position.

In our test run, the wheel landed on nuber 30, which is a red number, so we decided to recoup our losses with

bet 250 red

We won and were back at our original balance of $1000. Having narrowly avoided crippling losses, we decided to leave the casino terminal.

The game is simple and in addition to bet and start, there are only a few commands to remember:

money

... will show your current balance.

clearbets

... will retract your current bets - provided you input it before you type start.

to exit the roulette TUI, type:

exit

Additionally, you can bet on odds or evens - although you can't yet bet on columns or rows.

Have fun pretending to gamble in your terminal

terminalroulette is fun for the few minutes it will take you to run through your stack of chips, and is a fun way to pass the time while you wait for packages to download, set up your own XMPP server, or sync your photos with your self-hosted Google Photos alternative.