Set screen width and height as default variables

This commit is contained in:
coolneng 2022-06-10 20:12:02 +02:00
parent 234069ba85
commit 9a7246442c
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 4 additions and 5 deletions

View File

@ -3,12 +3,13 @@ from secrets import randbelow
from time import sleep from time import sleep
def erratic_movement(screen_width, screen_height): def erratic_movement(screen_width=800, screen_height=600):
""" """
Moves the cursor to a random position with the screen's width and height as an upper bound Moves the cursor to a random position with the screen's width and height as an upper bound
""" """
move( move(
randbelow(screen_width), randbelow(screen_height), randbelow(screen_width),
randbelow(screen_height),
) )
@ -16,10 +17,8 @@ def main():
""" """
Calls the movement function in an infinite loop, with a random delay between each call Calls the movement function in an infinite loop, with a random delay between each call
""" """
screen_width = 800
screen_height = 600
while True: while True:
erratic_movement(screen_width, screen_height) erratic_movement()
sleep(randbelow(90)) sleep(randbelow(90))