Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

Showdown
========

This town is not big enough for both of our bots

What is this?
-------------

Showdown is a game for two bots (and for the people to write those bots)

The rules
---------

.. image:: https://nerdist.com/wp-content/uploads/2016/08/Good-Bad-Ugly-Trio.jpg
:alt: Showdown (mexican standoff) from The Good, the Bad and the Ugly. (image from https://nerdist.com/)

Basics
^^^^^^

This game is played by 2 bots (a.k.a players), implemented as 2 different command line programs.

Each bot represents an opponent in a western movie style showdown. They both have a 6-bullet Colt, and start with one loaded bullet. The aim is to kill the opponent by shooting them while they are vulnerable.

Player play at the same time by issuing one of the 3 allowed commands : ``shoot``, ``dodge``, ``reload``. Then, if both player survive, they see what their opponent did, and start over, etc.

Who dies ?
^^^^^^^^^^

(A and B can be any of the 2 players)

- If A shoots while B reloads, B dies
- If A and B both shoot but B has no more bullets, B dies
- If A shoots while B issues an invalid command or their program has exited, B dies
- If B has not issued a command within one second (but their program is still running), B dies. This rule is to avoid bots that will slow the game at each and every turn.

In all other cases, the game continues.

Ammunition
^^^^^^^^^^

Each player start with 1 bullet in their gun. Shooting always removes a bullet from your gun (except if it's already empty). Reloading always adds a bullet to your gun (except if it already has 6 bullets and is full)

Turns & victory
^^^^^^^^^^^^^^^

The game stops when an opponent is dead, or when at least one opponent takes more than one second to give its intructions, or after 100 turns.

If there is no winner, the winner will be selected as the one who dodged the least frequently. If both opponent dodged the same amount of time, a winner is randomly selected.

Inputs, outputs, timings
^^^^^^^^^^^^^^^^^^^^^^^^

Here, ``print`` means write in stdout, followed by a newline (`\n`), and ``read``means read from stdin until newline.

The program should print its name (within 10 seconds after the start of the process)

Then, as long as the game is on, the program should loop over the two following action.

The program should print its action for the current turn among ``shoot``, ``dodge`` and ``reload``.
Then, the program may read the action the opponent did. The action may be ``shoot``, ``dodge``, ``reload``, ``shoot_no_bullet`` if the opponent shot bu had no bullet left, ``stand`` if the opponent sent an invalid command.

A program has one second after it receives the opponent's action to print its own action, otherwise the game will be terminated.

The program
-----------

.. code::bash

showdown first command with args -vs- second command with args

Release files for showdown 0.1.0.dev0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for showdown 0.1.0.dev0
File Size Uploaded
showdown-0.1.0.dev0.tar.gz 10.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for showdown 0.1.0.dev0
File Interpreter ABI Platform
showdown-0.1.0.dev0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 24.5 kB

Release files / showdown-0.1.0.dev0.tar.gz

Download URL showdown-0.1.0.dev0.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ce3629452204583f08d3e9b029a74c9d52f5c19506adb5890c5abe89971d3ba2
BLAKE2b-256 checksum
How to use checksums
2d56e19e8015a051d4b779ec2a54253a319bc1e1a6e534c9ed10bb34ce2b42e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / showdown-0.1.0.dev0-py2.py3-none-any.whl

Download URL showdown-0.1.0.dev0-py2.py3-none-any.whl
Size 13.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
8509f371a3b61b36a4f7777b376555ce4b4de2797ae6091684cba842521c338b
BLAKE2b-256 checksum
How to use checksums
93f68039814988a3f2c06bd293da8602c74b7e681cb2894b2e29307ad7f2039c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.0.dev0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page