Giter Club home page Giter Club logo

properprint's Introduction

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

properprint's People

Contributors

pentagonlp avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.