Methods
(static) clear()
Clear the console's text.
- Source:
(static) exists()
Check if the console exists.
Important to check before attempting to select and extract output.
- Source:
(static) getNamespaceModifcationString() → {string}
Generate strings for the public methods to bring them to the
public namespace without having to call them with the console instance.
- Source:
Returns:
Line broken function definitions.
- Type
- string
(static) getOutput() → {string}
Get the output from the console.
- Source:
Returns:
- Type
- string
(static) getStubString() → {string}
Generate stub strings for the public methods to bring them to the
namespace without having to call them with the console instance.
- Source:
Returns:
Line broken function definitions.
- Type
- string
(static) registerPublicMethod(name)
Adds a method to the public methods array.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Name of the method. |
- Source:
(static) setSolution(soln)
Set the solution code for a given exercise.
Parameters:
Name | Type | Description |
---|---|---|
soln |
string | Solution code. |
- Source:
checkOutput()
Check the console output for correctness against solution code.
returns {object} Dictionary containing boolean of success and message.
- Source:
print(ln)
Print a line to the console.
Parameters:
Name | Type | Description |
---|---|---|
ln |
string | The string to print. |
- Source:
println(ln)
Print a line to the console.
Parameters:
Name | Type | Description |
---|---|---|
ln |
string | The string to print. |
- Source:
readBoolean(str) → {str}
Read a bool from the user.
Parameters:
Name | Type | Description |
---|---|---|
str |
str | A message associated with the modal asking for input. |
- Source:
Returns:
The result of the readBoolean prompt.
- Type
- str
readLine(str) → {str}
Read a line from the user.
Parameters:
Name | Type | Description |
---|---|---|
str |
str | A message associated with the modal asking for input. |
- Source:
Returns:
The result of the readLine prompt.
- Type
- str
readLinePrivate(str, looping)
Private method used to read a line.
Parameters:
Name | Type | Description |
---|---|---|
str |
string | The line to be read. |
looping |
boolean | Unsure. This is a messy method. |
- Source:
runCode(code)
This is how you run the code, but get access to the
state of the console library. The current instance
becomes accessible in the code.
Parameters:
Name | Type | Description |
---|---|---|
code |
string | The code from the editor. |
- Source: