fizzbuzzer 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/HISTORY.md +3 -0
- data/Manifest.txt +6 -0
- data/README.md +57 -0
- data/Rakefile +29 -0
- data/lib/fizzbuzzer.rb +11 -0
- data/lib/fizzbuzzer/version.rb +23 -0
- metadata +90 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7cce129d72a233da5127749a82679db77546bbdd
|
4
|
+
data.tar.gz: e300f3f6a540fcd6343fcb341089b9040bdd4d08
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5ed98feb599ea8764bcc714baf771ef45e7fd838f7dee6a67242b2efbff8985187891642539db63343c6ae9f60d975099280a26054d154c891bd972344fc6b4f
|
7
|
+
data.tar.gz: 67cb59c03123cb4b535e48f9be54e481116cde503cf82c099df64ca2f2b8a0b78b67168ce09758a2b086d175e2c5b7afda99d6504db43674d7bc3d6ed58aaf81
|
data/HISTORY.md
ADDED
data/Manifest.txt
ADDED
data/README.md
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
# FizzBuzzer
|
2
|
+
|
3
|
+
fizzbuzzer - 1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, Fizz Buzz, ... - a collection of algorithms for playing the word game for children that teaches division (one of the four basic arithmetic operations in mathematics)
|
4
|
+
or helps you find the world's best coders in programming job interviews
|
5
|
+
- are you (re)using the fizzbuzzer library? ;-) - don't reinvent the wheel or
|
6
|
+
the feedbuzzer!
|
7
|
+
|
8
|
+
|
9
|
+
## Usage
|
10
|
+
|
11
|
+
Q: Can you code a program for the fizz buzz word game for the first hundred numbers?
|
12
|
+
|
13
|
+
A:
|
14
|
+
|
15
|
+
```
|
16
|
+
$ fizzbuzz
|
17
|
+
|
18
|
+
1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, Fizz Buzz, 16, 17, Fizz, 19, Buzz, Fizz, 22, 23, Fizz, Buzz, 26, Fizz, 28, 29, Fizz Buzz, 31, 32, Fizz, 34, Buzz, Fizz, ...
|
19
|
+
```
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
## Algorithms
|
24
|
+
|
25
|
+
Creating a list of the first hundred Fizz buzz numbers
|
26
|
+
is a trivial problem for any computer programer, so interviewers can easily sort out those with insufficient programming ability. Can they?
|
27
|
+
|
28
|
+
|
29
|
+
### Gold Standard
|
30
|
+
|
31
|
+
Lookup pre-calculated constants. Fast. Faster. Fastest.
|
32
|
+
|
33
|
+
``` ruby
|
34
|
+
|
35
|
+
```
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
## Install
|
42
|
+
|
43
|
+
Just install the gem:
|
44
|
+
|
45
|
+
$ gem install fizzbuzzer
|
46
|
+
|
47
|
+
|
48
|
+
## License
|
49
|
+
|
50
|
+
The `fizzbuzzer` scripts are dedicated to the public domain.
|
51
|
+
Use it as you please with no restrictions whatsoever.
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
## Questions? Comments?
|
56
|
+
|
57
|
+
Send them along to the ruby-talk mailing list. Thanks!
|
data/Rakefile
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'hoe'
|
2
|
+
require './lib/fizzbuzzer/version.rb'
|
3
|
+
|
4
|
+
Hoe.spec 'fizzbuzzer' do
|
5
|
+
|
6
|
+
self.version = FizzBuzzer::VERSION
|
7
|
+
|
8
|
+
self.summary = "fizzbuzzer - 1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, Fizz Buzz, ... - a collection of algorithms for playing the word game for children that teaches division (one of the four basic arithmetic operations in mathematics) or helps you find the world's best coders in programming job interviews - are you (re)using the fizzbuzzer library? ;-) - don't reinvent the wheel or the feedbuzzer!"
|
9
|
+
self.description = summary
|
10
|
+
|
11
|
+
self.urls = ['https://github.com/rubylibs/fizzbuzzer']
|
12
|
+
|
13
|
+
self.author = 'Gerald Bauer'
|
14
|
+
self.email = 'wwwmake@googlegroups.com'
|
15
|
+
|
16
|
+
# switch extension to .markdown for gihub formatting
|
17
|
+
self.readme_file = 'README.md'
|
18
|
+
self.history_file = 'HISTORY.md'
|
19
|
+
|
20
|
+
self.extra_deps = [
|
21
|
+
]
|
22
|
+
|
23
|
+
self.licenses = ['Public Domain']
|
24
|
+
|
25
|
+
self.spec_extras = {
|
26
|
+
required_ruby_version: '>= 2.3'
|
27
|
+
}
|
28
|
+
|
29
|
+
end
|
data/lib/fizzbuzzer.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
|
4
|
+
module FizzBuzzer
|
5
|
+
|
6
|
+
MAJOR = 0
|
7
|
+
MINOR = 0
|
8
|
+
PATCH = 1
|
9
|
+
VERSION = [MAJOR,MINOR,PATCH].join('.')
|
10
|
+
|
11
|
+
def self.version
|
12
|
+
VERSION
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.banner
|
16
|
+
"fizzbuzzer/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.root
|
20
|
+
"#{File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )}"
|
21
|
+
end
|
22
|
+
|
23
|
+
end # module FizzBuzzer
|
metadata
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fizzbuzzer
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Gerald Bauer
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-01-22 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rdoc
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4.0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '4.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: hoe
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.16'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.16'
|
41
|
+
description: fizzbuzzer - 1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13,
|
42
|
+
14, Fizz Buzz, ... - a collection of algorithms for playing the word game for children
|
43
|
+
that teaches division (one of the four basic arithmetic operations in mathematics)
|
44
|
+
or helps you find the world's best coders in programming job interviews - are you
|
45
|
+
(re)using the fizzbuzzer library? ;-) - don't reinvent the wheel or the feedbuzzer!
|
46
|
+
email: wwwmake@googlegroups.com
|
47
|
+
executables: []
|
48
|
+
extensions: []
|
49
|
+
extra_rdoc_files:
|
50
|
+
- HISTORY.md
|
51
|
+
- Manifest.txt
|
52
|
+
- README.md
|
53
|
+
files:
|
54
|
+
- HISTORY.md
|
55
|
+
- Manifest.txt
|
56
|
+
- README.md
|
57
|
+
- Rakefile
|
58
|
+
- lib/fizzbuzzer.rb
|
59
|
+
- lib/fizzbuzzer/version.rb
|
60
|
+
homepage: https://github.com/rubylibs/fizzbuzzer
|
61
|
+
licenses:
|
62
|
+
- Public Domain
|
63
|
+
metadata: {}
|
64
|
+
post_install_message:
|
65
|
+
rdoc_options:
|
66
|
+
- "--main"
|
67
|
+
- README.md
|
68
|
+
require_paths:
|
69
|
+
- lib
|
70
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '2.3'
|
75
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
requirements: []
|
81
|
+
rubyforge_project:
|
82
|
+
rubygems_version: 2.5.2
|
83
|
+
signing_key:
|
84
|
+
specification_version: 4
|
85
|
+
summary: fizzbuzzer - 1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14,
|
86
|
+
Fizz Buzz, ... - a collection of algorithms for playing the word game for children
|
87
|
+
that teaches division (one of the four basic arithmetic operations in mathematics)
|
88
|
+
or helps you find the world's best coders in programming job interviews - are you
|
89
|
+
(re)using the fizzbuzzer library? ;-) - don't reinvent the wheel or the feedbuzzer!
|
90
|
+
test_files: []
|