Skip to content

Library for ComputerCraft/CC: Tweaked to print with indentation

License

Notifications You must be signed in to change notification settings

PentagonLP/properprint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ProperPrint

projectstage projectstage license issues
contributors activity lastcommit
size files languages

Library for the minecraft mod ComputerCraft/CC: Tweaked to print in terminal with indentation

How to install

FileUtils can be installed using the ComputerCraft Package Tool by using the following commands:

Install CCPT, only run if you havn't installed it yet:

pastebin run syAUmLaF

If you install CCPT, this library will also be installed as CCPT depends on it. The library has the ccpt ID "pprint":

ccpt info pprint

The library will now be stored in "/lib/properprint".

How to use

  1. As shown here, when using the function properprint.pprint([texttoprint]), every line from the second line onwards has one space of indentation.
    Content of 'test':
os.loadAPI("properprint")
properprint.pprint("The quick brown fox jumps over the lazy dog. He broke his legs in the process.")

Output:
test1

2. As shown here, when using the function properprint.pprint([texttoprint],[indentation]), every line from the second line onwards still has one space more of indentation, but every line has the specified amount of spaces as indentation added by default.
Content of 'test2':

os.loadAPI("properprint")
properprint.pprint("The quick brown fox jumps over the lazy dog. He broke his legs in the process.",5)

Output:
test2
3. As shown here, you can use the function getLastCharPosition([haystack],[needle]) to find the last position of a character in a string. Though that's not the main purpose of the library and appeared more as a helper function, maybe it's useful to you.
Content of 'test3':

os.loadAPI("properprint")
print(properprint.getLastCharPosition("So long, and thanks for all the fish!","l"))

Output:
test2

Last words

Well, thats basicly all there is to say! This library is very small, but it is what it is. If you find bugs, please report them so I can fix them.
This is my first time publishing something on github, so feel free to point out things I could do better. Also, english is not my first language, so if you find any spelling/language-related mistakes, please tell me.
Have a nice day,
PentagonLP

About

Library for ComputerCraft/CC: Tweaked to print with indentation

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages