357
you are viewing a single comment's thread
view the rest of the comments
[-] joyjoy@lemm.ee 64 points 2 years ago

You call that russian roulette? This is real russian roulette. Dying is a 1/6 probability.

#!/usr/bin/env python3
import random

barrel = [0, 0, 0, 0, 0, 1]
random.shuffle(barrel)

print("Russian Roulette")
for i in barrel:
  input("Press enter to shoot")
  if i == 1:
    print("You are dead.")
    exit()
  else:
    print("Phew. You survived.")
[-] librecat@lemmy.basedcount.com 20 points 2 years ago

I love this, except for i i hate i.

[-] problematicPanther@lemmy.world 11 points 2 years ago

but it's easier than thinking of a useful variable name.

[-] kogasa@programming.dev 5 points 2 years ago
load more comments (1 replies)
load more comments (6 replies)
load more comments (7 replies)
this post was submitted on 19 Feb 2024
357 points (95.0% liked)

Programmer Humor

29783 readers
1079 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS