You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.0 KiB
38 lines
1.0 KiB
5 years ago
|
#!/usr/bin/env python3
|
||
|
|
||
|
from asciiWriter.patterns import sinus_vertical
|
||
4 years ago
|
from asciiWriter.utils import make_lines, visit, print_lines, merge, translate
|
||
5 years ago
|
from asciiWriter.marks import sentence, space
|
||
|
|
||
|
import random
|
||
|
|
||
|
# Define width and height of the output
|
||
4 years ago
|
width = 125
|
||
|
height = 90
|
||
5 years ago
|
|
||
|
# As we draw multiple sinoids we will collect
|
||
|
# them in a list of layers
|
||
|
layers = []
|
||
|
|
||
|
# Loop through an amplitude of -50 to 50 in steps of 10
|
||
4 years ago
|
for amplitude in range(-40, 50, 10):
|
||
5 years ago
|
# Set the pattern with the changing amplitude
|
||
4 years ago
|
pattern = sinus_vertical(period=60, amplitude=amplitude)
|
||
5 years ago
|
# We use a sentence to draw the text
|
||
4 years ago
|
mark = sentence('VARIA-')
|
||
5 years ago
|
# Define a blank character
|
||
4 years ago
|
blank = space('-')
|
||
5 years ago
|
|
||
|
# Make the canvas
|
||
|
lines = make_lines(width, height)
|
||
|
# Draw the sinoid, but add it to the list
|
||
|
result = visit(lines, pattern, mark, blank)
|
||
|
# Add it the result to the list of layers
|
||
|
layers.append(result)
|
||
|
|
||
|
# Merge the layers into one layer again
|
||
|
merged = merge(width, height, blank(), layers)
|
||
|
|
||
|
# Print the result
|
||
|
print_lines(merged)
|