Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scruss/7567570ba07c4c839622a63ce3049cc3 to your computer and use it in GitHub Desktop.
Save scruss/7567570ba07c4c839622a63ce3049cc3 to your computer and use it in GitHub Desktop.
"The Prime Minister Won't Resign", an implementation of Oliver Darkshire's one page RPG - https://twitter.com/deathbybadger/status/1545372201402114049
#!/usr/bin/env python3
#
# Implementation of Oliver Darkshire's one page RPG
# "The Prime Minister Won't Resign", published 2022-07-08
# https://twitter.com/deathbybadger/status/1545372201402114049
#
# written in deliberately simple python by scruss, 2022-07
# -*- coding: utf-8 -*-
import random
random.seed() # every game should be different
trail = 0
media = 0
wounds = 0
sixes = 0
def roll():
# roll a pretend six-side die
# print result with no newline
# crap out if three consecutive sixes rolled
global sixes
d = random.randint(1, 6)
if d == 6:
sixes = sixes+1
else:
sixes = 0
print(d, end='')
if sixes == 3:
print("\t *** Sudden Brexit ***")
print("\t\tyou accidentally leave the European Union,")
print("\t\tand drown in the ocean.")
print()
exit()
else:
return(d)
# prologue
print("The Prime Minister Won't Resign")
print("an implementation of an Oliver Darkshire one page RPG")
print("see https://twitter.com/deathbybadger/status/1545372201402114049")
print()
print("you are the queen of england")
print("and the prime minister won't resign")
print("which leaves you no choice but to perform your duty")
print("don your mask and draw excalibur one last time")
print()
while wounds < 10 and media < 10 and trail < 10:
print("\tWounds: %2d \tMedia: %2d \tThe Trail: %2d"
% (wounds, media, trail))
event = roll()
if event == 1 or event == 2:
print("\tRegal Event: Endless Corridors ...")
encounter = roll()
if encounter == 1:
print("\t\tYou wander into a work event. You leave holding a beer.")
trail = trail + 1
elif encounter == 2:
print("\t\tYou get stuck in a ministerial revolving door")
media = media + 1
elif encounter == 3:
print("\t\tIt's the chancellor, holding a bag marked SWAG")
trail = trail + 1
elif encounter == 4:
print("\t\tYou briefly get locked in combat with a cabinet")
wounds = wounds + 1
elif encounter == 5:
print("\t\tYou detect the smell of fear and silver spoons")
trail = trail + 2
else:
print("\t\tYou stop to cure a passerby of scrofula.")
media = media + 1
elif event == 3 or event == 4:
print("\tRegal Event: The Battle Rages On ...")
encounter = roll()
if encounter == 1:
print("\t\tYou summon the royal lion.")
print("\t\tIt's not as friendly as you remember.")
wounds = wounds + 1
elif encounter == 2:
print("\t\tYou battle through a room full of red tape")
wounds = wounds + 1
trail = trail + 1
elif encounter == 3:
print("\t\tYou are ambushed with a cake. Ow.")
wounds = wounds + 1
media = media + 1
elif encounter == 4:
print("\t\tYou are confronted by a minister. You end them.")
wounds = wounds + 1
elif encounter == 5:
print("\t\tA secretary of state catches you with a lucky blow.")
wounds = wounds + 1
trail = trail + 1
else:
print("\t\tYou choke someone to death with the Magna Carta")
wounds = wounds + 1
trail = trail + 1
else:
print("\tRegal Event: Affairs of State ...")
encounter = roll()
if encounter == 1 or encounter == 2:
print("\t\tOne of your relatives has caused")
print("\t\tan international scandal")
media = media + 1
elif encounter == 3:
print("\t\tYou lose your crown in the viscera and have to find it")
media = media + 1
elif encounter == 4:
print("\t\tYour dogs pick up a smell. The smell of vengeance.")
trail = trail + 2
else:
print("\t\tYou have to stop to celebrate another jubilee.")
print("\t\tIt's quite time consuming.")
media = media + 1
# the end
print()
print("\tWounds: %2d \tMedia: %2d \tThe Trail: %2d"
% (wounds, media, trail))
if wounds == 10:
print("\t\tyou are defeated and your rampage comes to an end.")
print("\t\tYour funeral is suitably expensive, and a colossus")
print("\t\tis raised over your tomb.")
elif media == 10:
print("\t\tyour identity is uncovered and the cameras force you")
print("\t\tback to the palace to nurse your injured pride.")
else:
print("\t\tyou finally catch up to the prime minister and")
print("\t\tbring an end to this farce. You stand on a pile of your")
print("\t\tdefeated enemies and howl at the uncaring gods above.")
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment