Skip to content

Instantly share code, notes, and snippets.

@unbibium
Created June 30, 2019 03:46
Show Gist options
  • Save unbibium/b9c66e67a0523d0cd55cdb933c1d6c02 to your computer and use it in GitHub Desktop.
Save unbibium/b9c66e67a0523d0cd55cdb933c1d6c02 to your computer and use it in GitHub Desktop.
Monty Python death server experiment with C64 receiver
#!/usr/local/bin/python3
#
# Usage: { sleep 2; ./pd.py; } | nc c64-address.lan 6400
#
# Open up CCGMS 2019 in ASCII mode and the wifi modem
# will receive everything.
from dead import *
import time
import sys
members = [
"http://www.dpsinfo.com/dps/cnames.html#gchapman",
"http://www.dpsinfo.com/dps/cnames.html#jcleese",
"http://www.dpsinfo.com/dps/jnames.html#tjones",
"http://www.dpsinfo.com/dps/inames.html#eidle",
"http://www.dpsinfo.com/dps/gnames.html#tgilliam",
"http://www.dpsinfo.com/dps/pnames.html#mpalin",
]
names = {
'mpalin': 'Michael Palin',
'gchapman': 'Graham Chapman',
'eidle': 'Eric Idle',
'tjones': 'Terry Jones',
'jcleese': 'John Cleese',
'tgilliam': 'Terry Gilliam'
}
scanners = list(map(DeathScanner, members))
colorMaps = {
'petscii': {
'green': "\x1e",
'red': "\x1c",
'gray': "\x9b",
},
'ansi': {
'green': "\033[32;1m",
'red': "\033[31;1m",
'gray': "\033[0;37m",
}
}
c = colorMaps['ansi']
deadDisplay = {
True: c['red'] + "DEAD" + c['gray'],
False: c['green'] + 'ALIVE' + c['gray'],
}
while True:
print("\014Scanning\r\n\r\n")
sys.stdout.flush();
time.sleep(5)
for m in scanners:
time.sleep(2)
m.scan()
print("%s: %s\r\n" % (names[m.anchorTag], deadDisplay[m.dead]))
sys.stdout.flush();
time.sleep(20)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment