Skip to content

Commit 3822b9a

Browse files
Merge pull request #2191 from NitkarshChourasia/testing
refactor: Improve security scripts
2 parents 2731d2e + cae90db commit 3822b9a

File tree

3 files changed

+125
-57
lines changed

3 files changed

+125
-57
lines changed

TowerOfHanoi.py

-14
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# PasswordGenerator GGearing 314 01/10/19
2+
# modified Prince Gangurde 4/4/2020
3+
4+
from random import randint
5+
import pycountry
6+
7+
case = randint(1, 2)
8+
number = randint(1, 999)
9+
10+
# TODO: Pick random country from it
11+
12+
countries = list(pycountry.countries)
13+
country_names = [country.name for country in countries]
14+
15+
print(country_names)
16+
17+
# TODO: Try to add languages, too.
18+
19+
specialCharacters = (
20+
"!",
21+
"@",
22+
"#",
23+
"$",
24+
"%",
25+
"/",
26+
"?",
27+
":",
28+
"<",
29+
">",
30+
"|",
31+
"&",
32+
"*",
33+
"-",
34+
"=",
35+
"+",
36+
"_",
37+
)
38+
39+
animals = (
40+
"ant",
41+
"alligator",
42+
"baboon",
43+
"badger",
44+
"barb",
45+
"bat",
46+
"beagle",
47+
"bear",
48+
"beaver",
49+
"bird",
50+
"bison",
51+
"bombay",
52+
"bongo",
53+
"booby",
54+
"butterfly",
55+
"bee",
56+
"camel",
57+
"cat",
58+
"caterpillar",
59+
"catfish",
60+
"cheetah",
61+
"chicken",
62+
"chipmunk",
63+
"cow",
64+
"crab",
65+
"deer",
66+
"dingo",
67+
"dodo",
68+
"dog",
69+
"dolphin",
70+
"donkey",
71+
"duck",
72+
"eagle",
73+
"earwig",
74+
"elephant",
75+
"emu",
76+
"falcon",
77+
"ferret",
78+
"fish",
79+
"flamingo",
80+
"fly",
81+
"fox",
82+
"frog",
83+
"gecko",
84+
"gibbon",
85+
"giraffe",
86+
"goat",
87+
"goose",
88+
"gorilla",
89+
)
90+
91+
colour = (
92+
"red",
93+
"orange",
94+
"yellow",
95+
"green",
96+
"blue",
97+
"indigo",
98+
"violet",
99+
"purple",
100+
"magenta",
101+
"cyan",
102+
"pink",
103+
"brown",
104+
"white",
105+
"grey",
106+
"black",
107+
)
108+
109+
chosenanimal = animals[
110+
randint(0, len(animals) - 1)
111+
] # randint will return max lenght but , tuple has index from 0 to len-1
112+
chosencolour = colour[randint(0, len(colour) - 1)]
113+
chosenSpecialCharacter = specialCharacters[randint(0, len(specialCharacters) - 1)]
114+
115+
if case == 1:
116+
chosenanimal = chosenanimal.upper()
117+
print(chosencolour + str(number) + chosenanimal + chosenSpecialCharacter)
118+
else:
119+
chosencolour = chosencolour.upper()
120+
print(chosenanimal + str(number) + chosencolour + chosenSpecialCharacter)
121+
122+
# Try to consolidate unify the characters.
123+
124+
125+
# The program can be further improved.

tower_of_hanoi.py

-43
This file was deleted.

0 commit comments

Comments
 (0)