fn: lolcat.on
[contents]

Contents

Nift console screenshot

Syntax

The syntax for lolcat.on calls is:

f++:  
lolcat.on
lolcat.on(string)

n++:  
@lolcat.on
@lolcat.on(string)

Description

The lolcat.on function is for turning on outputting text to the console with rainbow colours, it takes zero parameters or a single parameter. For internal output Nift uses the in-built version of lolcat-cc, however you can specify in the global and project configuration files which external lolcat program to use, depending on your preferences for things like speed and/or being able to watch animations, and possible formatting issues for edge cases like emojis.

Note: There is a modified version of my lolcat-cc in-built in to Nift which has a taste of what other platforms can do for Windows, however you can use lolcat.on with quite a few different lolcat implementations installed on your machine. It is available for:

Note: Nift will skip to the first non-whitespace (ie. to the first character that is not a space, tab or newline) after a lolcat.on call and inject it to the output file where the call started. If you want to prevent Nift from doing this put a '!' after the call, eg.:

@lolcat.on()!

Config

You can configure lolcat output being turned on automatically when running scripts along with the shell extensions and interpreters by adding the following to the global or project config file:

  • lolcat 1
  • lolcatCmd "lolcat-cc -f"
Note: you can use any lolcat program you want provided the command is set properly.

f++ example

Example of lolcat.on being used with f++:

:=(int, i=12)
:=(string, str="hello")
lolcat.on
console.lock
console("i: ", i)
console(str, ", world!")
console("first line", endl, "second line")
console{block}
{
	first line
	second line
	third line
}
console.unlock
lolcat.off

n++ example

Example of lolcat.on being used with n++:

@:=(int, i=12)
@:=(string, str="hello")
@lolcat.on
@console.lock
@console("i: ", i)
@console(str, ", world!")
@console("first line", endl, "second line")
@console{block}
{
	first line
	second line
	third line
}
@console.unlock
@lolcat.off

lolcat-cc mascot