rmathguard 0.1.0 → 0.1.1

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.
@@ -32,7 +32,7 @@ module RMathGuard
32
32
  digit.copy(self)
33
33
  digit.each_index do |row|
34
34
  digit[row].each_index do |col|
35
- digit[row][col] = PATTERN[rand(PATTERN.size)] unless digit[row][col] == 0
35
+ digit[row][col] = PATTERN[Kernel::rand(PATTERN.size)] unless digit[row][col] == 0
36
36
  end
37
37
  end
38
38
  digit
@@ -9,11 +9,13 @@ module RMathGuard
9
9
  def initialize(options = {})
10
10
  @max_value = options[:max_value] || 10
11
11
  @row_count = options[:row_count] || 5
12
- @col_count = options[:col_count] || 3
12
+ @col_count = options[:col_count] || options[:column_count] || 3
13
13
  @sep_size = options[:sep_size] || 2
14
14
 
15
- RMathGuard::Numbers.resize(@row_count, @col_count)
16
- RMathGuard::Operators.resize(@row_count, @col_count)
15
+ unless @row_count == 5 && @col_count == 3
16
+ RMathGuard::Numbers.resize(@row_count, @col_count)
17
+ RMathGuard::Operators.resize(@row_count, @col_count)
18
+ end
17
19
  generate
18
20
  end
19
21
 
@@ -25,7 +27,6 @@ module RMathGuard
25
27
  sign = o.const_get(OPERATORS[@operator]).masked
26
28
  eq = o::EQUALS.masked
27
29
 
28
-
29
30
  result = []
30
31
  (0...@row_count).each do |row|
31
32
  result[row] = []
data/lib/rmathguard.rb CHANGED
@@ -3,5 +3,5 @@ require 'rmathguard/number'
3
3
  require 'rmathguard/expression'
4
4
 
5
5
  module RMathGuard
6
- VERSION = "0.1.0"
7
- end
6
+ VERSION = "0.1.1"
7
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 0
9
- version: 0.1.0
8
+ - 1
9
+ version: 0.1.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - "Jakub Du\xC5\xA1ek"