tasks_gem 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 320490aaf8787bdc23fb5c352213f3bbfe29242fc3bd4f4b35b42fd202a3ecfd
4
- data.tar.gz: a196613a8ff98edab80e20a3680241d75905d517118a8555f5736b6ac054293a
3
+ metadata.gz: 2e8a6c3f3ce3438643e429617d424b5c59afecab3f31f9c5489c67fa324dee17
4
+ data.tar.gz: 443580e8cee882e8bce468b9e62e83c1f9ea7d4c97918ee694938ae18cc0fd0a
5
5
  SHA512:
6
- metadata.gz: 4048e9ca5334db01c9a5da2d5411a81f544c75fa889235fc41eb503f37f56e9c7905ec40a439b0b6f6624e4b817061f0b28441381e5be6f0cc1a16beff4644fc
7
- data.tar.gz: 127b752e4fe0241613e303d4506a0b9d31552026091243e469a015d0d036f86b15d1c48ab42f9d5cd086c8a78f9f1585cd59b71ee919893a5a2ce895ec985ef5
6
+ metadata.gz: 5a6aa5a7f13d17d2c40deea2f6a02633eed2defb2658a581681b4faed7f0bdd855a32820c509bac91ae58aece1bad085b5243140106995c080d4555a8e633adc
7
+ data.tar.gz: c6ca6d91b51ceafd83007bcf280c9158123e7c3275fb3d3377c5ccfebff9a4ea96315eef3406a8fa1cdf07ef47b6dfdb29b2d1a9fdbf6ac410924af3490e2aab
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tasks_gem (0.1.7)
4
+ tasks_gem (0.1.8)
5
5
  run_tests (~> 0.1.3)
6
6
 
7
7
  GEM
data/lib/tasks/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tasks
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
data/lib/tasks.rb CHANGED
@@ -268,6 +268,7 @@ module Tasks
268
268
  array = new_array(quantity: n)
269
269
  sum_array = 0
270
270
  (0..n - 1).each { |i| sum_array += array[i]**(i + 1) }
271
+ { array: array, sum: sum_array }
271
272
  end
272
273
 
273
274
  def task_325(n:)
@@ -410,12 +411,13 @@ module Tasks
410
411
  end
411
412
 
412
413
  def task_988(horse_num:)
413
- horse = (1..3).include? horse_num.to_i ? horse_num.to_i : 1
414
+ horse_num = horse_num.to_i
415
+ horse_num = 1 if (1..3).include? horse_num
414
416
  finish = 500
415
417
  horses_run = []
416
418
  3.times { horses_run.push(rand(1..100)) }
417
419
  while horses_run.max < finish
418
- horses_run = horses_num(run: horses_run, horse_num: horse)
420
+ horses_run = horses_num(run: horses_run, horse_num: horse_num)
419
421
  end
420
422
  horses_run[horse_num - 1] >= finish ? 'Victory!' : 'Try again.'
421
423
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tasks_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - marina8915