a1426kt_prime_number 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/a1426kt_prime_number-0.0.2.gem +0 -0
- data/lib/a1426kt_prime_number.rb +20 -1
- data/lib/a1426kt_prime_number/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a47b79953b3a97b342e1392204fd0e45eb2580a
|
4
|
+
data.tar.gz: e95956b2581383d5e8bddb2ccd100c5394ae9650
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ed0fe538bb5d9c9f6ed58abce7f1e3ae5764de5a6896617fb8b2f4e3206109dd0c739d4d7f9f169e955967bed38444e2b1736eb90be6da5ee247186c3267b34
|
7
|
+
data.tar.gz: 64e1721369cf135a91aecae3b4ec63a34f00e5cafdddea68232e4dd530ea4b892f592ae1fac12c27f264543180be985d37da0561424b1b7c462f0407f425320f
|
Binary file
|
data/lib/a1426kt_prime_number.rb
CHANGED
@@ -1,5 +1,24 @@
|
|
1
1
|
require "a1426kt_prime_number/version"
|
2
2
|
|
3
|
-
|
3
|
+
class A1426ktPrimeNumber
|
4
|
+
#module A1426ktPrimeNumber
|
4
5
|
# Your code goes here...
|
6
|
+
def determine_prime(num)
|
7
|
+
if num == 1 || num == 2 then
|
8
|
+
return "This is the prime number."
|
9
|
+
end
|
10
|
+
if num % 2 == 0 then
|
11
|
+
return "This is not the prime number."
|
12
|
+
end
|
13
|
+
i = 3
|
14
|
+
while true
|
15
|
+
if num == i then
|
16
|
+
return "This is the prime number."
|
17
|
+
end
|
18
|
+
if num % i == 0 then
|
19
|
+
return "This is not the prime number."
|
20
|
+
end
|
21
|
+
i = i + 2
|
22
|
+
end
|
23
|
+
end
|
5
24
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: a1426kt_prime_number
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kikuko toda
|
@@ -51,6 +51,7 @@ files:
|
|
51
51
|
- LICENSE.txt
|
52
52
|
- README.md
|
53
53
|
- Rakefile
|
54
|
+
- a1426kt_prime_number-0.0.2.gem
|
54
55
|
- a1426kt_prime_number.gemspec
|
55
56
|
- bin/a1426kt_prime_number
|
56
57
|
- lib/a1426kt_prime_number.rb
|