mirror of
https://github.com/dbisu/pico-ducky.git
synced 2025-12-06 02:41:45 +00:00
Add functions, while loops, and vars support (#264)
* Add functions, while loops, and vars support * Add back REPEAT * Add support for nested WHILE loops in function --------- Co-authored-by: Tony Le <tonyle@coxautoinc.com>
This commit is contained in:
13
examples/functions.dd
Normal file
13
examples/functions.dd
Normal file
@@ -0,0 +1,13 @@
|
||||
REM Example Function
|
||||
FUNCTION COUNTDOWN()
|
||||
REM The next four lines open Notepad in Windows and type "Hello World!"
|
||||
GUI r
|
||||
DELAY 1000
|
||||
STRING notepad
|
||||
ENTER
|
||||
DELAY 2000
|
||||
STRING Hello World!
|
||||
ENTER
|
||||
END_FUNCTION
|
||||
COUNTDOWN()
|
||||
|
||||
7
examples/while_loops.dd
Normal file
7
examples/while_loops.dd
Normal file
@@ -0,0 +1,7 @@
|
||||
VAR $TIME = 3
|
||||
WHILE ($TIME > 0)
|
||||
STRING .
|
||||
DELAY 500
|
||||
STRING While Looop!!
|
||||
ENTER
|
||||
END_WHILE
|
||||
Reference in New Issue
Block a user