fix grader
This commit is contained in:
parent
0f4b5ef855
commit
e030613517
1 changed files with 34 additions and 35 deletions
|
@ -21,41 +21,40 @@ def modinv(a, m):
|
||||||
def randleetify(s, random):
|
def randleetify(s, random):
|
||||||
i = list(s)
|
i = list(s)
|
||||||
for c in range(len(i)):
|
for c in range(len(i)):
|
||||||
if random.random() > 0.5:
|
if i[c] == 'i':
|
||||||
if i[c] == 'i':
|
if random.random() > 0.66:
|
||||||
if random.random() > 0.66:
|
i[c] = '1'
|
||||||
i[c] = '1'
|
elif random.random() > 0.33:
|
||||||
elif random.random() > 0.33:
|
i[c] = 'I'
|
||||||
i[c] = 'I'
|
elif i[c] == 'o':
|
||||||
elif i[c] == 'o':
|
if random.random() > 0.66:
|
||||||
if random.random() > 0.66:
|
i[c] = '0'
|
||||||
i[c] = '0'
|
elif random.random() > 0.33:
|
||||||
elif random.random() > 0.33:
|
i[c] = 'O'
|
||||||
i[c] = 'O'
|
elif i[c] == 'a':
|
||||||
elif i[c] == 'a':
|
if random.random() > 0.66:
|
||||||
if random.random() > 0.66:
|
i[c] = '4'
|
||||||
i[c] = '4'
|
elif random.random() > 0.33:
|
||||||
elif random.random() > 0.33:
|
i[c] = 'A'
|
||||||
i[c] = 'A'
|
elif i[c] == 'l':
|
||||||
elif i[c] == 'l':
|
if random.random() > 0.66:
|
||||||
if random.random() > 0.66:
|
i[c] = '1'
|
||||||
i[c] = '1'
|
elif random.random() > 0.33:
|
||||||
elif random.random() > 0.33:
|
i[c] = 'L'
|
||||||
i[c] = 'L'
|
elif i[c] == 's':
|
||||||
elif i[c] == 's':
|
if random.random() > 0.66:
|
||||||
if random.random() > 0.66:
|
i[c] = '5'
|
||||||
i[c] = '5'
|
elif random.random() > 0.33:
|
||||||
elif random.random() > 0.33:
|
i[c] = 'S'
|
||||||
i[c] = 'S'
|
elif i[c] == 'e':
|
||||||
elif i[c] == 'e':
|
if random.random() > 0.66:
|
||||||
if random.random() > 0.66:
|
i[c] = '3'
|
||||||
i[c] = '3'
|
elif random.random() > 0.33:
|
||||||
elif random.random() > 0.33:
|
i[c] = 'E'
|
||||||
i[c] = 'E'
|
elif i[c].isalpha():
|
||||||
elif i[c].isalpha():
|
if random.random() > 0.5:
|
||||||
if random.random() > 0.5:
|
i[c] = i[c].upper()
|
||||||
i[c] = i[c].upper()
|
return ''.join(i)
|
||||||
return ''.join(i)
|
|
||||||
|
|
||||||
def get_problem(random):
|
def get_problem(random):
|
||||||
n_length = 2048
|
n_length = 2048
|
||||||
|
|
Loading…
Reference in a new issue