geekhub_tasks 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/geekhub_tasks.rb +9 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5be0c8d3b1fdc4da0d455c2295b0f17c559705c57efb4e35cdfc4f1679f4f289
|
4
|
+
data.tar.gz: 19de5cad77b45e28af057c06d111ea6f71989c7c642f03a7d93572630cd02a30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2cae7bb5e76a4425b60969dbb1d28dc1ed45ba18afd15a235f2fec456e4f696b1a20f3678f76db2ee7241bb4f9fc8a1335800463a900eb22fb555db0889ad6d
|
7
|
+
data.tar.gz: 2fd478c8f6c7d72dbfb8a2f9c7ae5b7fa44901112c2f06056c89a3b86dc385236c9119bc12f0ac0fa9c5ff089b2a26c7bb9514133be501734f437b2f0035c7cd
|
data/lib/geekhub_tasks.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
class GeekHubTasks
|
2
2
|
|
3
|
-
def self.
|
3
|
+
def self.area__hyptenuse_triangle(a, b)
|
4
4
|
hypotenuse = Math.sqrt( ( a**2 ) + ( b**2 ) ).round(2)
|
5
5
|
area = ( a * b )/2
|
6
6
|
{ hypotenuse: hypotenuse, area: area }
|
@@ -47,7 +47,7 @@ class GeekHubTasks
|
|
47
47
|
{ s: s }
|
48
48
|
end
|
49
49
|
|
50
|
-
def self.
|
50
|
+
def self.volume(v_1, t_1, v_2, t_2)
|
51
51
|
z = v_1 + v_2
|
52
52
|
t = ( ( v_1 * t_1 ) + ( v_2 * t_2 ) )/z.to_i
|
53
53
|
{ v: z,
|
@@ -125,7 +125,7 @@ class GeekHubTasks
|
|
125
125
|
{s: s}
|
126
126
|
end
|
127
127
|
|
128
|
-
def self.
|
128
|
+
def self.first_last_digit(n)
|
129
129
|
x = n.to_s.length # number of digits in number
|
130
130
|
z = n.to_s.chars.map { |sum,n| sum = sum.to_i + n.to_i} # display sum
|
131
131
|
x = n.to_s.split('')
|
@@ -136,7 +136,7 @@ class GeekHubTasks
|
|
136
136
|
{ :f => f, :s => s, :t => t}
|
137
137
|
end
|
138
138
|
|
139
|
-
def self.
|
139
|
+
def self.palindrope(n)
|
140
140
|
if n.to_s.reverse == n.to_s
|
141
141
|
p = "This number is palindrome"
|
142
142
|
else
|
@@ -178,7 +178,7 @@ class GeekHubTasks
|
|
178
178
|
{ f: x }
|
179
179
|
end
|
180
180
|
|
181
|
-
def self.
|
181
|
+
def self.equal_number(k, l)
|
182
182
|
if k != l
|
183
183
|
sol = "k != l"
|
184
184
|
#k = ( k + l) && l = ( k + l )
|
@@ -200,7 +200,7 @@ class GeekHubTasks
|
|
200
200
|
{ :z => z }
|
201
201
|
end
|
202
202
|
|
203
|
-
def self.
|
203
|
+
def self.simple_operation(x, y)
|
204
204
|
sum = x + y
|
205
205
|
diff = x - y
|
206
206
|
comp = x * y
|
@@ -245,7 +245,7 @@ class GeekHubTasks
|
|
245
245
|
sol2: y }
|
246
246
|
end
|
247
247
|
|
248
|
-
def self.
|
248
|
+
def self.ariphmetic(a, b)
|
249
249
|
c = ( Math.sqrt( ( b**2 ) - ( a ** 2 ) ) ).round(0)
|
250
250
|
r = ( ( a + c - b)/2 ).round(0)
|
251
251
|
{ c: c,
|
@@ -383,7 +383,7 @@ class GeekHubTasks
|
|
383
383
|
{ result: result }
|
384
384
|
end
|
385
385
|
|
386
|
-
def self.
|
386
|
+
def self.include_number(n)
|
387
387
|
if n.to_s.include?("3")
|
388
388
|
p = "Yes,include"
|
389
389
|
else
|
@@ -437,7 +437,7 @@ class GeekHubTasks
|
|
437
437
|
{ rez1: s1, rez2: t2 }
|
438
438
|
end
|
439
439
|
|
440
|
-
def self.
|
440
|
+
def self.divisor(a, b)
|
441
441
|
x = a.to_i.gcdlcm b.to_i
|
442
442
|
if a.to_i == 0 || b.to_i == 0
|
443
443
|
p = "Danger!You try division on 0"
|