Set screen width and height as default variables
This commit is contained in:
parent
234069ba85
commit
9a7246442c
|
@ -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))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue