Skip to content

Instantly share code, notes, and snippets.

@Epicguru
Created July 17, 2018 18:51
Show Gist options
  • Save Epicguru/c1b98f47cf8bc0783c3863ef72f8d2c7 to your computer and use it in GitHub Desktop.
Save Epicguru/c1b98f47cf8bc0783c3863ef72f8d2c7 to your computer and use it in GitHub Desktop.
Generates random char lines.
# Generates random lines given a few parameters;
# the lines are made up nonsense.
import random
charCount = 100
charOffset = 0
charMulti = 1
lineCount = 10
lineSize = (50, 100)
chars = []
for i in range(charCount):
chars.append(chr(int((i + charOffset) * charMulti)))
lines = []
for i in range(lineCount):
line = ""
s = random.randint(lineSize[0], lineSize[1])
for i in range(s):
line += chars[random.randint(0, len(chars) - 1)]
lines.append(line)
for l in lines:
print(l)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment