Code Monkey home page Code Monkey logo

tomtools's Introduction

tomtools

Useful tools for simple C++ operations

Prompting

Use these to get typed data from the user.

Simply get the user input without any prompt output.

promptBlank( input)

Outputs the given string, followed by a space, then waits for the user to input data and returns it.

prompt( input, string prompt)

Outputs the string followed by " [yes/no]" and will only accept: yes, y, 1, no, n, 0

Returns as a bool

promptYN(string prompt)

Random

Generates a pseudorandom number between the given ints. (inclusive)

randomInt(int minInclusive, int maxInclusive)

Sets the random seed to the current time (which is random enough for most needs)

seedRandom()

Output

See tomtools.h for visuals of what these outputs look like.

Simply output the given text to cout followed by endl (overloaded for outputting float, double, char, int as well)

print(string text)

Centered text, surrounded by the decoration

boxBanner(string text, char decoration)

Centered text, flanked by the decoration

banner(string text, char decoration)

Centered text

center(string text)

Platform-specific functions for determining the width in characters of the terminal. Doesn't work on macs.

termWidth()

Write out an amount of spaces equal to count

space(int count)

Repeat the given char a number of times

repeatChar(char fill, int size)

Write a line consisting entirely of the given char

fillLine(char fill);

tomtools's People

Contributors

thristhart avatar

Watchers

Nogweii avatar  avatar James Cloos avatar  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.