ques 0.0.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.
- checksums.yaml +7 -0
- data/lib/ques.rb +89 -0
- metadata +43 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: e99eb2c93178931f1a1be75a6a2951d804ce7aaa
|
|
4
|
+
data.tar.gz: 422ca0303655f52eac1ab388fa31ed035880a3c5
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 52b03fb332e2bc146b2569b89a4616f4d04ebb1faa83768382ddb873889eeb252247248875446b493b806b34ad3b8f8c9f6d259fc44e38a89b585d0bb7eb983d
|
|
7
|
+
data.tar.gz: c12c4572e7bc2e1a821337bbfa84d335583528c8debfbbe8c7411fbfc4ee14dbfac317c6e218f8758d63b857a1cb47534eed5f37c819f873446f77bb519c8c56
|
data/lib/ques.rb
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
class Createquestions
|
|
2
|
+
def self.generator()
|
|
3
|
+
#Questions for multiplication
|
|
4
|
+
|
|
5
|
+
variable1 = rand(100...200)
|
|
6
|
+
variable2 = rand(100...200)
|
|
7
|
+
question1 = "#{variable1} x #{variable2} = ?"
|
|
8
|
+
ans1 = variable1 * variable2
|
|
9
|
+
puts question1
|
|
10
|
+
puts ans1
|
|
11
|
+
|
|
12
|
+
variable3 = rand(200...300)
|
|
13
|
+
variable4 = rand(100...200)
|
|
14
|
+
question2 = "#{variable3} x #{variable4} = ?"
|
|
15
|
+
ans2 = variable3 * variable4
|
|
16
|
+
puts question2
|
|
17
|
+
puts ans2
|
|
18
|
+
|
|
19
|
+
variable5 = rand(200...300)
|
|
20
|
+
variable6 = rand(100...200)
|
|
21
|
+
question3 = "#{variable5} x #{variable6} = ?"
|
|
22
|
+
ans3 = variable5 * variable6
|
|
23
|
+
puts question3
|
|
24
|
+
puts ans3
|
|
25
|
+
|
|
26
|
+
#Questions for Additions
|
|
27
|
+
num1 = rand(100...200)
|
|
28
|
+
num2 = rand(100...200)
|
|
29
|
+
num3 = rand(1000...20000)
|
|
30
|
+
question4 = "#{num1} + #{num2} + #{num3} = ?"
|
|
31
|
+
ans4 = num1 + num2 + num3
|
|
32
|
+
puts question4
|
|
33
|
+
puts ans4
|
|
34
|
+
|
|
35
|
+
num4 = rand(100...200)
|
|
36
|
+
num5 = rand(100...200)
|
|
37
|
+
num6 = rand(1000...20000)
|
|
38
|
+
question5 = "#{num4} + #{num5} + #{num6} = ?"
|
|
39
|
+
ans5 = num4 + num5 + num6
|
|
40
|
+
puts question5
|
|
41
|
+
puts ans5
|
|
42
|
+
|
|
43
|
+
num7 = rand(100...200)
|
|
44
|
+
num8 = rand(100...200)
|
|
45
|
+
num9 = rand(1000...20000)
|
|
46
|
+
question6 = "#{num7} + #{num8} + #{num9} = ?"
|
|
47
|
+
ans6 = num7 + num8 + num9
|
|
48
|
+
puts question6
|
|
49
|
+
puts ans6
|
|
50
|
+
|
|
51
|
+
#Questions for Substractions
|
|
52
|
+
number1 = rand(1000...2000)
|
|
53
|
+
number2 = rand(100...200)
|
|
54
|
+
number3 = rand(100...200)
|
|
55
|
+
question7 = "#{number1} - #{number2} - #{number3} = ?"
|
|
56
|
+
ans7 = number1 - number2 - number3
|
|
57
|
+
puts question7
|
|
58
|
+
puts ans7
|
|
59
|
+
|
|
60
|
+
number4 = rand(1000...2000)
|
|
61
|
+
number5 = rand(100...200)
|
|
62
|
+
number6 = rand(100...200)
|
|
63
|
+
question8 = "#{number4} - #{number5} - #{number6} = ?"
|
|
64
|
+
ans8 = number4 - number5 - number6
|
|
65
|
+
puts question8
|
|
66
|
+
puts ans8
|
|
67
|
+
|
|
68
|
+
number7 = rand(1000...2000)
|
|
69
|
+
number8 = rand(100...200)
|
|
70
|
+
number9 = rand(100...200)
|
|
71
|
+
question9 = "#{number7} - #{number8} - #{number9} = ?"
|
|
72
|
+
ans9 = number7 - number8 - number9
|
|
73
|
+
puts question9
|
|
74
|
+
puts ans9
|
|
75
|
+
#Complicated additional question
|
|
76
|
+
nr1 = rand(10...20)
|
|
77
|
+
nr2 = rand(10...20)
|
|
78
|
+
nr3 = rand(100...200)
|
|
79
|
+
question10 = "#{nr1} x #{nr2} + #{nr3} = ?"
|
|
80
|
+
ans10 = nr1 * nr2 + nr3
|
|
81
|
+
puts question10
|
|
82
|
+
puts ans10
|
|
83
|
+
return ans1, question1, ans2, question2, ans3, question3,ans4, question4,ans5, question5,ans6, question6,ans7, question7,ans8, question8,ans9, question9,ans10, question10
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
metadata
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: ques
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Aliona Lobanova
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2015-04-25 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: maths
|
|
14
|
+
email: alionkal@list.ru
|
|
15
|
+
executables: []
|
|
16
|
+
extensions: []
|
|
17
|
+
extra_rdoc_files: []
|
|
18
|
+
files:
|
|
19
|
+
- lib/ques.rb
|
|
20
|
+
homepage: http://rubygems.org/gems/ques
|
|
21
|
+
licenses: []
|
|
22
|
+
metadata: {}
|
|
23
|
+
post_install_message:
|
|
24
|
+
rdoc_options: []
|
|
25
|
+
require_paths:
|
|
26
|
+
- lib
|
|
27
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
28
|
+
requirements:
|
|
29
|
+
- - ">="
|
|
30
|
+
- !ruby/object:Gem::Version
|
|
31
|
+
version: '0'
|
|
32
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
33
|
+
requirements:
|
|
34
|
+
- - ">="
|
|
35
|
+
- !ruby/object:Gem::Version
|
|
36
|
+
version: '0'
|
|
37
|
+
requirements: []
|
|
38
|
+
rubyforge_project:
|
|
39
|
+
rubygems_version: 2.2.2
|
|
40
|
+
signing_key:
|
|
41
|
+
specification_version: 4
|
|
42
|
+
summary: gem generates random qs and answers
|
|
43
|
+
test_files: []
|