chatgpt/shashasha.py

32 lines
667 B
Python
Raw Normal View History

2023-05-25 22:41:28 +03:00
#!/usr/bin/python3.10
2023-05-25 22:47:04 +03:00
"""
This is simple script that gives out quite random chars.
Like we almost won eurovision.
"""
2023-05-25 22:41:28 +03:00
from hashlib import sha256
from random import randint
runs = 400
turn = 0
start = "Hello There, friend!"
2023-05-25 22:47:04 +03:00
2023-05-25 22:41:28 +03:00
def turns_and_runs(turn, input, end):
2023-05-25 22:47:04 +03:00
input_bytes = input.encode()
input_hash = sha256(input_bytes)
return_blob = input_hash.hexdigest()
if turn < runs:
my_random = randint(10, 60)
end += return_blob[my_random]
return_blob = return_blob + return_blob + str(my_random)
end = turns_and_runs(turn + 1, return_blob, end)
2023-05-25 22:41:28 +03:00
2023-05-25 22:47:04 +03:00
return end
2023-05-25 22:41:28 +03:00
2023-05-25 22:47:04 +03:00
result = turns_and_runs(turn, start, "")
2023-05-25 22:41:28 +03:00
print(result)