Print

Examples

red("Red text")
green("Green text")
blue("Blue text")
purple("Purple text")

@red "Red text (macro)"
@green "Green text (macro)"
@blue "Blue text (macro)"
@purple "Purple text (macro)"
Red text
Green text
Blue text
Purple text
Red text (macro)
Green text (macro)
Blue text (macro)
Purple text (macro)

APIs

Junimo.cprintFunction
cprint(text, code)
cprint(io, text, code)

Print text to standard output using the specified ANSI color code.

This is a low-level utility function for customized terminal output.

Arguments

  • text: The string to print.
  • code: The integer ANSI color code (e.g., 31 for red, 32 for green).
  • io: Optional IO stream to write to.

Examples

cprint("System initialized", 33) # Prints yellow text
cprint(stderr, "Warning", 33)
source
Junimo.redFunction
red(text)
red(io, text)

Print a line of text in Red (ANSI 31).

Typically used for errors, warnings, or to indicate "Bad Luck" (the Red Skull from the Fortune Teller).

Examples

red("Error: Data mismatch detected!")
red(stderr, "Error: Data mismatch detected!")
source
Junimo.greenFunction
green(text)
green(io, text)

Print a line of text in Green (ANSI 32).

This is the color of the Junimos. Use this to indicate success, completed tasks, or stable model conditions.

Examples

green("Processing complete. Junimos are happy.")
green(stderr, "Processing complete. Junimos are happy.")
source
Junimo.blueFunction
blue(text)
blue(io, text)

Print a line of text in Blue (ANSI 34).

Use this for general information, hydrological data outputs, or water-related metrics.

Examples

blue("Lake level stabilized.")
blue(stderr, "Hydrology data missing.")
source
Junimo.purpleFunction
purple(text)
purple(io, text)

Print a line of text in Purple (ANSI 35).

This is the color of Iridium and Stardrops. Use this for high-priority messages, significant results, or "Great Luck" days.

Examples

purple("Optimization finished! Results are Iridium quality.")
purple(stderr, "Optimization finished! Results are Iridium quality.")
source
Junimo.@redMacro
@red text
@red io text

Print a line of text in Red (ANSI 31).

This macro expands to red(text) or red(io, text).

Examples

@red "Error: Data mismatch detected!"
@red stderr "Error: Data mismatch detected!"
source
Junimo.@greenMacro
@green text
@green io text

Print a line of text in Green (ANSI 32).

This macro expands to green(text) or green(io, text).

Examples

@green "Processing complete. Junimos are happy."
@green stderr "Processing complete. Junimos are happy."
source
Junimo.@blueMacro
@blue text
@blue io text

Print a line of text in Blue (ANSI 34).

This macro expands to blue(text) or blue(io, text).

Examples

@blue "Lake level stabilized."
@blue stderr "Hydrology data missing."
source
Junimo.@purpleMacro
@purple text
@purple io text

Print a line of text in Purple (ANSI 35).

This macro expands to purple(text) or purple(io, text).

Examples

@purple "Optimization finished! Results are Iridium quality."
@purple stderr "Optimization finished! Results are Iridium quality."
source