lottery 0.0.4 → 0.0.5
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 +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +31 -16
- data/lib/lottery/command.rb +13 -7
- data/lib/lottery/taiwan.rb +15 -2
- data/lib/lottery/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5df2d74c3dbce8419c53f26a119a1f9025634a8a
|
4
|
+
data.tar.gz: 5de18a84c8c0c74be2f640f1ede278b0acfff2c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c01b2fb50fe6204ea5131e488dc6a3b2ad354ba0801cf82a68d5be11469cbe96a8e74c5401d1172bac18f27c90da0e3932c9b683e19b7a1c4adffa8315bca10
|
7
|
+
data.tar.gz: 31f894cb06ff8826912db3b4fd12f4fbba09f2e1daceab470ea8b6e19d41a2ccbfeae762b805df5c27025a0c81c89188c6b95e804c7550b9e535709ccf10c658
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
|
1
2
|
# Lottery
|
2
3
|
|
3
4
|
Go buy a ticket by 100% Ruby chosen numbers and be the next jackpot winner!
|
@@ -10,6 +11,20 @@ Install Lottery:
|
|
10
11
|
|
11
12
|
## Where are you from?
|
12
13
|
|
14
|
+
### Spain?
|
15
|
+
|
16
|
+
__Generate Daily 6/49:__
|
17
|
+
|
18
|
+
lottery es
|
19
|
+
|
20
|
+
__Generate Sunday 5/54+1:__
|
21
|
+
|
22
|
+
lottery es 1
|
23
|
+
|
24
|
+
__Generate Spanish 6/49:__
|
25
|
+
|
26
|
+
lottery es 2
|
27
|
+
|
13
28
|
### Europe?
|
14
29
|
|
15
30
|
__Generate Euro Million Numbers:__
|
@@ -24,33 +39,33 @@ __Generate Thunderball Numbers:__
|
|
24
39
|
|
25
40
|
lottery eu 2
|
26
41
|
|
27
|
-
###
|
28
|
-
|
29
|
-
__Generate Daily 6/49:__
|
30
|
-
|
31
|
-
lottery es
|
42
|
+
### Taiwan?
|
32
43
|
|
33
|
-
|
44
|
+
__產生[威力彩][superlotto638]號碼:__
|
34
45
|
|
35
|
-
lottery
|
46
|
+
lottery tw
|
36
47
|
|
37
|
-
|
48
|
+
__產生[大樂透][lotto649]號碼:__
|
38
49
|
|
39
|
-
lottery
|
50
|
+
lottery tw 1
|
40
51
|
|
41
|
-
|
52
|
+
__產生[今彩 539][dc539] 號碼:__
|
42
53
|
|
43
|
-
|
54
|
+
lottery tw 2
|
44
55
|
|
45
|
-
|
56
|
+
__產生[三星彩][3d]號碼:__
|
46
57
|
|
47
|
-
|
58
|
+
lottery tw 3
|
48
59
|
|
49
|
-
|
60
|
+
__產生[四星彩][4d]號碼:__
|
50
61
|
|
51
|
-
|
62
|
+
lottery tw 4
|
52
63
|
|
53
|
-
|
64
|
+
[superlotto638]: http://www.taiwanlottery.com.tw/SuperLotto638/index.asp
|
65
|
+
[lotto649]: http://www.taiwanlottery.com.tw/Lotto649/index.asp
|
66
|
+
[dc539]: http://www.taiwanlottery.com.tw/DailyCash/index.asp
|
67
|
+
[3d]: http://www.taiwanlottery.com.tw/3D/index.asp
|
68
|
+
[4d]: http://www.taiwanlottery.com.tw/4D/index.asp
|
54
69
|
|
55
70
|
## Contributing
|
56
71
|
|
data/lib/lottery/command.rb
CHANGED
@@ -24,23 +24,29 @@ module Lottery
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
desc 'tw [type]', 'Lotteries in Taiwan. Including Lotto649, SuperLotto638, and
|
28
|
-
long_desc <<-
|
27
|
+
desc 'tw [type]', 'Lotteries in Taiwan. Including Lotto649, SuperLotto638, Daily Cash, 3 stars and 4 stars.'
|
28
|
+
long_desc <<-TW_LONGDESC
|
29
29
|
$ lottery tw
|
30
30
|
|
31
|
-
generates Taiwanese Lottery numbers. Support SuperLotto638, Lotto649, and
|
31
|
+
generates Taiwanese Lottery numbers. Support SuperLotto638, Lotto649, Daily Cash, 3 stars and 4 stars.
|
32
32
|
|
33
33
|
$ lottery tw will generate SuperLotto638 numbers.
|
34
34
|
|
35
35
|
$ lottery tw 1 will generate Lotto649 numbers.
|
36
36
|
|
37
37
|
$ lottery tw 2 will generate Daily Cash numbers.
|
38
|
-
|
38
|
+
|
39
|
+
$ lottery tw 3 will generate 3 stars numbers.
|
40
|
+
|
41
|
+
$ lottery tw 4 will generate 4 stars numbers.
|
42
|
+
TW_LONGDESC
|
39
43
|
def tw(which = 0)
|
40
44
|
case which.to_i
|
41
|
-
when 1 then puts '6/49 Lotto:';
|
42
|
-
when 2 then puts 'Daily Cash 539:';
|
43
|
-
|
45
|
+
when 1 then puts '6/49 Lotto:'; Lottery::Taiwan.lotto_649.pprint
|
46
|
+
when 2 then puts 'Daily Cash 539:'; Lottery::Taiwan.daily_cash_539.pprint
|
47
|
+
when 3 then printf "3 stars: %s\n" % Lottery::Taiwan.three_stars
|
48
|
+
when 4 then printf "4 stars: %s\n" % Lottery::Taiwan.four_stars
|
49
|
+
else puts 'Super Lotto 638:'; Lottery::Taiwan.super_lotto_638.pprint first_name: '1st zone', second_name: '2nd zone'
|
44
50
|
end
|
45
51
|
end
|
46
52
|
|
data/lib/lottery/taiwan.rb
CHANGED
@@ -13,10 +13,23 @@ module Lottery
|
|
13
13
|
make_hash(draw(49, 6))
|
14
14
|
end
|
15
15
|
|
16
|
-
# Daily Cash
|
17
|
-
def
|
16
|
+
# Daily Cash 539
|
17
|
+
def daily_cash_539
|
18
18
|
make_hash(draw(39, 5))
|
19
19
|
end
|
20
20
|
|
21
|
+
def three_stars
|
22
|
+
digit_draw
|
23
|
+
end
|
24
|
+
|
25
|
+
def four_stars
|
26
|
+
digit_draw(4)
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def digit_draw(digits=3)
|
32
|
+
('0' * digits ..'9' * digits).to_a.sample
|
33
|
+
end
|
21
34
|
end
|
22
35
|
end
|
data/lib/lottery/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lottery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juanito Fatas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|