mfittko / primes-multiplication-table

Code Exercise -- Write a program that outputs a multiplication table of the first 10 prime numbers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Coding challenge

Objective

Write a program that prints out a multiplication table of the first 10 prime numbers. The program must run from the command line and print one table to STDOUT. The first row and column of the table should have the 10 primes, with each cell containing the product of the primes for the corresponding row and column.

Notes • Consider complexity. How fast does your code run? How does it scale? • Consider cases where we want N primes. • Do not use the Prime class from stdlib (write your own code). • Write tests. Try to demonstrate TDD/BDD.

When you’re done

Put your code on GitHub or email us a zip/tarball.

Usage

ruby lib/app.rb – renders a multiplication table of first 10 primes.

ruby lib/app.rb -s 5 – specify custom size of the table

ruby lib/app -h – shows help

About

Code Exercise -- Write a program that outputs a multiplication table of the first 10 prime numbers.


Languages

Language:Ruby 100.0%