mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
scripts: generate-alt-random-writes: mix \e[S with \n
This commit is contained in:
parent
e1bde0b0e7
commit
1e1fb157dc
1 changed files with 5 additions and 1 deletions
|
|
@ -69,7 +69,11 @@ def main():
|
|||
|
||||
lines_to_scroll = rand.read(1)[0] % (lines - 1)
|
||||
rev = rand.read(1)[0] % 2
|
||||
out.write(f'\033[{lines_to_scroll + 1}{"T" if rev == 1 else "S"}')
|
||||
if not rev and rand.read(1)[0] % 2:
|
||||
out.write(f'\033[{lines};{cols}H')
|
||||
out.write('\n' * lines_to_scroll)
|
||||
else:
|
||||
out.write(f'\033[{lines_to_scroll + 1}{"T" if rev == 1 else "S"}')
|
||||
continue
|
||||
|
||||
# Generate a random location and a random character
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue