randomgenerator 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/randomgenerator.rb +26 -0
- metadata +46 -0
@@ -0,0 +1,26 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
module RandomGenerator
|
4
|
+
def self.getRandomOperation
|
5
|
+
arr = ["+","-","*","+","-","*","+","-","*"]
|
6
|
+
return arr[rand(arr.size)]
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.getRandomNumber
|
10
|
+
return rand(20)
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.operate(input1,input2,operation)
|
14
|
+
output = 0
|
15
|
+
if(operation=="+")
|
16
|
+
output = input1+input2
|
17
|
+
elsif(operation=="-")
|
18
|
+
output = input1-input2
|
19
|
+
elsif(operation=="*")
|
20
|
+
output = input1*input2
|
21
|
+
end
|
22
|
+
return output
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: randomgenerator
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Mohan
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2014-02-28 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: Captcha based on encyrpting and decrypting user data by mathematical
|
15
|
+
operation
|
16
|
+
email: mohansatya@gmail.com
|
17
|
+
executables: []
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- lib/randomgenerator.rb
|
22
|
+
homepage: http://rubygems.org/gems/helloWorld
|
23
|
+
licenses: []
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
|
+
none: false
|
36
|
+
requirements:
|
37
|
+
- - ! '>='
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
requirements: []
|
41
|
+
rubyforge_project:
|
42
|
+
rubygems_version: 1.8.28
|
43
|
+
signing_key:
|
44
|
+
specification_version: 3
|
45
|
+
summary: captcha based on mathematical operation
|
46
|
+
test_files: []
|