Created
July 17, 2018 18:51
-
-
Save Epicguru/c1b98f47cf8bc0783c3863ef72f8d2c7 to your computer and use it in GitHub Desktop.
Generates random char lines.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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