From 9a7246442c160d4955b2111ce174f5b21a1b9f11 Mon Sep 17 00:00:00 2001 From: coolneng Date: Fri, 10 Jun 2022 20:12:02 +0200 Subject: [PATCH] Set screen width and height as default variables --- proarbeit.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/proarbeit.py b/proarbeit.py index c12b014..0f6971e 100644 --- a/proarbeit.py +++ b/proarbeit.py @@ -3,12 +3,13 @@ from secrets import randbelow 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 """ 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 """ - screen_width = 800 - screen_height = 600 while True: - erratic_movement(screen_width, screen_height) + erratic_movement() sleep(randbelow(90))