Code & Go game
Last week, during a Computing for Mathematics tutorial, Vince came up with what he thought was a brilliant idea.
It was that during a Code Club session, we would each go up to a laptop that was hooked up to the projector and type one line of code and then walk away. We would do this a number of times and then run the code.
So as he was not here for that weeks Code Club, he decided to do it in the last
session. It was decided that the editor we would use would be Atom as it is a
usable and friendly editor unlike Vim. We therefore had to use my laptop and Sam
and Geraint then spent all of their prep time
working ways they could mess up
my terminal. I had expected better of Sam.
The code from our first go:
import os
import random
import math
def olo(x, y, z, s):
random.randint = lambda x, y: 1
while True:
os.system('clear')
file = open("GOOD LUCK ADAM", "w")
print "WHY ARE WE DOING THIS GERAINT"
fun = False
for i in range(random.randint(1,21)):
True, False = False, TabError
if random.random() < 0.5:
True, False = False, True
if True != False:
pass
alist = [random.randint(0, 10) for i in range(10)]
ateam = map(lambda i: [[chr(j) for j in range(random.randint(97,123))] for i in range(i) ], alist)
for obj in alist:
if fun:
break
while not fun:
file.write("hello world")
[file.write(str(i)) for i in ateam]
break
The code from our second go:
import random as supercalifragilisticexpialidocious
import os as so
if supercalifragilisticexpialidocious.random() < 0.0001:
so.system("echo \"alias atom=\"vim\"\" >> ~/.bashrc")
so.system("echo \"xterm -fg red -bg yellow\" >> ~\.bashrc")
names = ['Ballistic Missile', 'Vince is ANNOYING', 'Sagetastic Sausage']
if False:
names = supercalifragilisticexpialidocious
for r in range(2000):
i = names.index('Vince is ANNOYING')
supercalifragilisticexpialidocious.shuffle(names)
False = names
for j in False:
if r % len(j) != 0:
pass
while i < r:
i = (i+1)%(r+1)
if r % 2 == 0:
random = False
random = open("/dev/urandom", 'r')
def randomseter():
random = 5