This program has been disqualified.
Author | Eth |
Submission date | 2012-04-25 21:47:33.013318 |
Rating | 7551 |
Matches played | 68 |
Win rate | 76.47 |
class PoliteGhost(object): #SophistGhost without the disqualifying bug
def __init__(self):
self.s = "S"
self.eqcount = 0
self.eqmode = 0
def __getslice__(self, i, j):
return self.s.__getslice__(i, j)
def __setslice__(self, i, j, sequence):
return self.s.__setslice__(i, j, sequence)
def __delslice__(self, i, j):
return self.s.__delslice__(i, j)
def __add__(self, other):
return self.s.__add__(other)
def __radd__(self, other):
return other + self.s
#def __iadd__(self, other):
# return self.s.__iadd__(other)
def __mul__(self, other):
return self.s.__mul__(other)
def __rmul__(self, other):
return other * self.s
#def __imul__(self, other):
# return self.s.__imul__(other)
def __len__(self):
return self.s.__len__()
def __getitem__(self, key):
return self.s.__getitem__(key)
def __setitem__(self, key, value):
return self.s.__setitem__(key, value)
def __delitem__(self, key):
return self.s.__delitem__(key)
def __iter__(self):
return self.s.__iter__()
def __reversed__(self):
return self.s.__reversed__()
def __contains__(self, item):
return self.s.__contains__(item)
def capitalize(self):
return self.s.capitalize()
def isalnum(self):
return self.s.isalnum()
def isalpha(self):
return self.s.isalpha()
def isdigit(self):
return self.s.isdigit()
def islower(self):
return self.s.islower()
def isspace(self):
return self.s.isspace()
def istitle(self):
return self.s.istitle()
def isupper(self):
return self.s.isupper()
def lower(self):
return self.s.lower()
def swapcase(self):
return self.s.swapcase()
def title(self):
return self.s.title()
def upper(self):
return self.s.upper()
def join(self, seq):
return self.s.join(seq)
def zfill(self, width):
return self.s.zfill(width)
def center(self, width, fillchar = None):
if(fillchar == None):
return self.s.center(width)
else:
return self.s.center(width, fillchar)
def expandtabs(self, tabsize = None):
if(tabsize == None):
return self.s.expandtabs()
else:
return self.s.expandtabs(tabsize)
def ljust(self, width, fillchar = None):
if(fillchar == None):
return self.s.ljust(width)
else:
return self.s.ljust(width, fillchar)
def lstrip(self, chars = None):
if(chars == None):
return self.s.lstrip()
else:
return self.s.lstrip(chars)
def replace(self, old, new, count = None):
if(count == None):
return self.s.replace(old, new)
else:
return self.s.replace(old, new, count)
def rjust(self, width, fillchar = None):
if(fillchar == None):
return self.s.rjust(width)
else:
return self.s.rjust(width, fillchar)
def rstrip(self, chars = None):
if(chars == None):
return self.s.rstrip()
else:
return self.s.rstrip(chars)
def splitlines(self, keepends = None):
if(keepends == None):
return self.s.splitlines()
else:
return self.s.splitlines(keepends)
def strip(self, chars = None):
if(chars == None):
return self.s.strip()
else:
return self.s.strip(chars)
def translate(self, table, deletechars = None):
if(deletechars == None):
return self.s.translate(table)
else:
return self.s.translate(table, deletechars)
#my kindness has reasonable limits
def count(self, sub, start = None, end = None):
return self.s.count(sub)
def decode(self, encoding = None, errors = None):
return self.s.decode()
def encode(self, encoding = None, errors = None):
return self.s.encode()
def endswith(self, suffix, start = None, end = None):
return self.s.endswith(suffix)
def find(self, sub, start = None, end = None):
return self.s.find(sub)
def index(self, sub, start = None, end = None):
return self.s.index(sub)
def rfind(self, sub, start = None, end = None):
return self.s.rfind(sub)
def rindex(self, sub, start = None, end = None):
return self.s.rindex(sub)
def split(self, sep = None, maxsplit = None):
return self.s.split()
def rsplit(self, sep = None, maxsplit = None):
return self.s.rsplit()
def startswith(self, prefix, start = None, end = None):
return self.s.startswith(prefix)
def __ne__(self, other):
if(self.eqcount == 0):
return False
else:
return self.s != other
def __eq__(self, other):
if(self.eqmode == 0 and other == "P"):
ret = True
self.eqmode = 1
elif(self.eqcount == 1 and self.eqmode == 0 and other == "S"):
ret = True #may as well
self.eqmode = 1
elif(self.eqcount == 2 and self.eqmode == 1 and other == "S"):
ret = False #necessary but slightly troubling
else:
ret = self.s == other
self.eqcount += 1
return ret
output = PoliteGhost()