-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #195 from KennyOliver/issue-194
Issue 194: Add Built-In `sleep()` for Pausing Execution
- Loading branch information
Showing
8 changed files
with
98 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Standard Library Functions | ||
|
||
| **Function** | **Description** | | ||
| -------------- | ------------------------------------------------------------------ | | ||
| `string` | Casts a value to a string. | | ||
| `float` | Casts a value to a float. | | ||
| `int` | Casts a value to an integer. | | ||
| `sample` | Reads input from the terminal. | | ||
| `serve` | Outputs data to the terminal. | | ||
| `burn` | Raises an error. If uncaught, it terminates the program. | | ||
| `random` | Generates a random number: | | ||
| | - 0 args: a random float between `0` and `1`. | | ||
| | - 1 arg: a random integer between `0` and the given max value. | | ||
| | - 2 args: a random integer between the given min and max values. | | ||
| `get_time` | Returns the current UNIX timestamp. | | ||
| `taste_file` | Reads the content of a file. | | ||
| `plate_file` | Writes data to a file (overwrites the file if it already exists). | | ||
| `garnish_file` | Appends data to a file. | | ||
| `length` | Returns the length of a string or array. | | ||
| `sleep` | Pauses program execution for the specified number of milliseconds. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
for i in 100..=1 by -5 { | ||
serve(i); | ||
sleep(i * 10); | ||
} |