Git Product home page Git Product logo

javaprintf's Introduction

javaprintf

Just another implementation of printf (c/php-like) and print (Python-like) (and some more functions) in java, by William Martinez Bas

History

Every time I start to study a new language, I miss the lost structures/commands/statements. So I try to construct that lost functions in the new programming language I'm studying. I started this practice a very long time ago, around 1988. This is my practical introduction to modern java language, dragging old customs.

Implemented functions/procedures

print -> it is a function that prints to stdout whatever kind of object is submitted in its parameters. (Python's print-like)

printf-> provides a c/php-like printf (or an aproximation to it).

background(n)-> set paper colour to n (number or Pcolour).

foreground(n)-> set ink colour to n (number or Icolour).

printc-> set colours to background and foreground, and then, print.

input-> prompt a message and return a string row from stdin.

clrscr-> ansi code for clear screen;

gotoxy-> ansi code move cursor to x column, y row

type/typeof-> returns a string guessing which type of data is provided as a parameter.

isarray-> is true if the parameter is an array

isinteger-> is true if the parameter is an integer

isdouble-> is true if the parameter type is double

len-> return string.length or array.length

rnd-> random double number; the parameter is a multiplying coefficient.

rndInt-> random integer number; the parameter is a multiplying coefficient.

Constants

I* -> Ink (foreground) colours to console with ansi codes { IGREY; IBLACK; IRED; IGREEN; IYELLOW; IBLUE; IMAGENTA; ICYAN; IWHITE }

P* -> Paper (background) colours to console with ansi codes { PGREY; PBLACK; PRED; PGREEN; PYELLOW; PBLUE; PMAGENTA; PCYAN; PWHITE }

Contribution

If you want to contribute, contact [email protected]

Thanks a lot! w

javaprintf's People

Contributors

metfar avatar

Watchers

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.