Giter VIP home page Giter VIP logo

prime-mul-table's Introduction

prime-mul-table

Command line program that prints out a multiplication table of the first 'n' prime numbers, default to n = 10.

Build

To build the standalone JAR file, use:

$ lein uberjar

Usage

To run from terminal, use the JAR file:

$ java -jar prime-mul-table-1.0.0-standalone.jar [args]

Options

These options are accepted as arguments:

-n, --n <number>   The number of prime numbers in multiplication table. (default: 10)
-t, --time         Show elapsed time (including finding primes and construction/printing of table)

Examples

To create a multiplication table of the first 6 prime numbers:

$ java -jar prime-mul-table-1.0.0-standalone.jar -n 6

Output:

     |   2 |   3 |   5 |   7 |  11 |  13 |
-----+-----+-----+-----+-----+-----+-----+
   2 |   4 |   6 |  10 |  14 |  22 |  26 |
-----+-----+-----+-----+-----+-----+-----+
   3 |   6 |   9 |  15 |  21 |  33 |  39 |
-----+-----+-----+-----+-----+-----+-----+
   5 |  10 |  15 |  25 |  35 |  55 |  65 |
-----+-----+-----+-----+-----+-----+-----+
   7 |  14 |  21 |  35 |  49 |  77 |  91 |
-----+-----+-----+-----+-----+-----+-----+
  11 |  22 |  33 |  55 |  77 | 121 | 143 |
-----+-----+-----+-----+-----+-----+-----+
  13 |  26 |  39 |  65 |  91 | 143 | 169 |
-----+-----+-----+-----+-----+-----+-----+

Run Tests

The test suite can be run with:

$ lein test

Documentation

License

Copyright © 2019 Christopher Elwell

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

prime-mul-table's People

Contributors

celwell avatar

Watchers

 avatar  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.