Skip to content

Commit 1c9224c

Browse files
authored
Merge pull request #24 from SenhasD/main
New feature patch (ASCII Art and TODO list)
2 parents b3e0549 + 7a7190e commit 1c9224c

File tree

3 files changed

+86
-1
lines changed

3 files changed

+86
-1
lines changed

TODO.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## TODO List for 1to5pc/python-auth
2+
### Readability
3+
- [x] Create a readme
4+
- [ ] Implementing wiki
5+
### GUI Release
6+
- [ ] Intergrate with tkinter or pygame for gui
7+
- [ ] Rename current cli version to legacy
8+
- [ ] Create new python file for gui version to ship with latest version
9+
### Nice-to-haves
10+
- [x] Create ASCII art
11+
- [x] Auto launch ASCII art and set the cat to random position each time
12+
- [x] Intergrate ASCII file to main.py and make it run everytime the file is opened
13+
- [ ] Intergrate ASCII art feature toggle abilities in config file

art.py

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import random
2+
3+
# Define the ASCII art for the text
4+
text_art = r"""
5+
____ _ _
6+
| _ \ _ _| |_| |__ ___ _ __
7+
| |_) | | | | __| '_ \ / _ \| '_ \
8+
| __/| |_| | |_| | | | (_) | | | |
9+
|_| \__, |\__|_| |_|\___/|_| |_|
10+
|___/
11+
"""
12+
13+
# Define the ASCII art for the cat
14+
cat_art = r"""
15+
/\_/\
16+
( o.o )
17+
> ^ <
18+
"""
19+
20+
def insert_cat_randomly(text_art, cat_art):
21+
text_lines = text_art.split('\n')
22+
cat_lines = cat_art.split('\n')
23+
24+
max_text_width = max(len(line) for line in text_lines)
25+
max_cat_width = max(len(line) for line in cat_lines)
26+
27+
# Calculate a random start position for the cat
28+
num_positions = len(text_lines) - len(cat_lines)
29+
start_position = random.randint(0, num_positions)
30+
31+
# Combine text and cat art
32+
combined_art = []
33+
for i, line in enumerate(text_lines):
34+
if i >= start_position and i < start_position + len(cat_lines):
35+
cat_line = cat_lines[i - start_position]
36+
combined_line = line.ljust(max_text_width) + " " + cat_line
37+
else:
38+
combined_line = line
39+
combined_art.append(combined_line)
40+
41+
return "\n".join(combined_art)
42+
43+
# Insert the cat randomly and print the result
44+
#combined_art = insert_cat_randomly(text_art, cat_art)
45+
#print(combined_art)
46+

main.py

+27-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,28 @@
1+
# initialise required libs
2+
import art
13
import usrcheck
2-
usrcheck.main_menu()
4+
import random
5+
# initialise ASCII art
6+
# Define the ASCII art for the text
7+
text_art = r"""
8+
____ _ _
9+
| _ \ _ _| |_| |__ ___ _ __
10+
| |_) | | | | __| '_ \ / _ \| '_ \
11+
| __/| |_| | |_| | | | (_) | | | |
12+
|_| \__, |\__|_| |_|\___/|_| |_|
13+
|___/
14+
"""
15+
16+
# Define the ASCII art for the cat
17+
cat_art = r"""
18+
/\_/\
19+
( o.o )
20+
> ^ <
21+
"""
22+
# initialise other required python files
23+
24+
combined_art = art.insert_cat_randomly(text_art, cat_art)
25+
print(combined_art)
26+
usrcheck.main_menu()
27+
28+

0 commit comments

Comments
 (0)