Project

General

Profile

README.md

Quiz description - claytonflesher (Clayton Flesher), 01/05/2016 07:00 PM

Download (1.27 KB)

 
1
# Nth Prime
2

    
3
Write a program that can tell you what the nth prime is.
4

    
5
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that
6
the 6th prime is 13.
7

    
8
If your language provides methods in the standard library to deal with prime
9
numbers, pretend it doesn't exist and implement it yourself.
10

    
11
* * * *
12

    
13
For installation and learning resources, refer to the
14
[exercism help page](http://help.exercism.io/getting-started-with-ruby.html).
15

    
16
For running the tests provided, you will need the Minitest gem. Open a
17
terminal window and run the following command to install minitest:
18

    
19
    gem install minitest
20

    
21
If you would like color output, you can `require 'minitest/pride'` in
22
the test file, or note the alternative instruction, below, for running
23
the test file.
24

    
25
In order to run the test, you can run the test file from the exercise
26
directory. For example, if the test suite is called
27
`hello_world_test.rb`, you can run the following command:
28

    
29
    ruby hello_world_test.rb
30

    
31
To include color from the command line:
32

    
33
    ruby -rminitest/pride hello_world_test.rb
34

    
35
The test files may have the execution bit set so you may also be able to
36
run it like this:
37

    
38
    ./hello_world_test.rb
39

    
40

    
41
## Source
42

    
43
A variation on Problem 7 at Project Euler [view source](http://projecteuler.net/problem=7)