Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add generator of false-ceasar texts #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Random Text Generator/imitation_of_text.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import string
import random

upper = string.ascii_uppercase
lower = string.ascii_lowercase

n_sentences = 10
n_max_length_word = 7
n_min_length_word = 2


def get_word(n):
return "".join(random.choices(lower, k=n))

def get_length():
return random.randint(n_min_length_word, n_max_length_word)

def get_text():
out = ""
for i in range(10):
out += random.choice(upper) + get_word(get_length())
word_count = random.randint(1, 10)
out += " ".join([get_word(get_length()) for i in range(word_count)])+ ". "
return out

print(get_text())


#the output looks like it was crypted with Caesar or other one-to-one substitution cipher
#so this program could be used for confusing one's minds