enjoy_markov 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f6c065a65983dda60d64aa6f0bba2f3d06eb56b6
4
- data.tar.gz: 2b8262763ad810e61f9b751791f7d60a17e29152
3
+ metadata.gz: 1432418a2351140ca320e9771b2058cc6ce95fdf
4
+ data.tar.gz: 22f751483977909917323b95df8335681dc4b1e3
5
5
  SHA512:
6
- metadata.gz: 98179eed00b2756a65d29da24d8309065e8e8ebfcd77bfbca139bd549a6900e968bde0c1ebca814f96aca57035fc637905d54510814d6ebd94b32451f2a22eca
7
- data.tar.gz: a987b60ae49423f8a909d9e11f10e12cc7eb58e993cd4fabb5809ef581360ca178571895d0219b85a49669d6cd89b55fec302334ae4074dab47275c432c7f0a5
6
+ metadata.gz: 0e1c58bd815425d2c21a956b1c3012ebaa117b25a086c5bcd5b7e28e16f78514eaf3a4da109ce1480e30b957fb273ecec6a64c868753c0aeac5e4857b3a635e7
7
+ data.tar.gz: 15d5a26fc26f0d31aae1a1a574e330b013878122a6ca219c72351cdd56fe4dc7a666e9d0ae585a89696e4149631ac3a53ee7f88d457ef87dbb88bac7d55ccf95
data/README.md CHANGED
@@ -1,31 +1,20 @@
1
- # EnjoyMarkov
1
+ # Enjoy! Markov
2
2
 
3
- TODO: Write a gem description
3
+ [![Gyazo](http://i.gyazo.com/73ec9ff893e88a3893fe07bb6793d2b8.gif)](http://gyazo.com/73ec9ff893e88a3893fe07bb6793d2b8)
4
4
 
5
- ## Installation
6
-
7
- Add this line to your application's Gemfile:
8
-
9
- ```ruby
10
- gem 'enjoy_markov'
11
- ```
12
-
13
- And then execute:
14
-
15
- $ bundle
16
-
17
- Or install it yourself as:
5
+ ## How to use it
18
6
 
19
7
  $ gem install enjoy_markov
8
+ $ enjoy_markov
9
+ $ enjoy_markov -r 30 -s 0.03
10
+ $ enjoy_markov -s 0.1
20
11
 
21
- ## Usage
12
+ #### Option
13
+ -r ... range. Defalut: 20
22
14
 
23
- TODO: Write usage instructions here
15
+ -s ... sleep time(sec) after each trial. Defalut: 0.05
24
16
 
25
- ## Contributing
17
+ ## License
18
+ Copyright (c) 2014 gogotanaka
26
19
 
27
- 1. Fork it ( https://github.com/[my-github-username]/enjoy_markov/fork )
28
- 2. Create your feature branch (`git checkout -b my-new-feature`)
29
- 3. Commit your changes (`git commit -am 'Add some feature'`)
30
- 4. Push to the branch (`git push origin my-new-feature`)
31
- 5. Create a new Pull Request
20
+ MIT License
data/bin/enjoy_markov CHANGED
@@ -2,4 +2,9 @@
2
2
 
3
3
  require 'enjoy_markov'
4
4
 
5
- EnjoyMarkov.start!
5
+ range, speed = 20, 0.05
6
+
7
+ speed = ARGV[ARGV.index('-s') + 1].to_f if ARGV.include?('-s')
8
+ range = ARGV[ARGV.index('-r') + 1].to_i if ARGV.include?('-r')
9
+
10
+ EnjoyMarkov.start!(range, speed)
@@ -1,3 +1,3 @@
1
1
  class EnjoyMarkov
2
- VERSION = "0.0.2"
2
+ VERSION = "0.1.0"
3
3
  end
data/lib/enjoy_markov.rb CHANGED
@@ -1,13 +1,14 @@
1
1
  class EnjoyMarkov
2
2
  class << self
3
- def start!(supinf=20)
3
+ def start!(supinf, speed)
4
4
  @@x = 0
5
5
  loop do
6
6
  @@x += [-1, 1].sample # TODO: use prefer randmGen
7
- raise 'ops.. ;(' if supinf == @@x.abs
7
+ break if supinf == @@x.abs
8
8
  puts "#{wall}#{space * supinf}#{axis}#{space * supinf}#{wall}".tap { |s| s[@@x + supinf + 1] = point }
9
- sleep 0.05
9
+ sleep speed
10
10
  end
11
+ puts 'Ops... ;('
11
12
  end
12
13
 
13
14
  private
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enjoy_markov
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - gogotanaka
@@ -61,17 +61,12 @@ extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
63
  - ".gitignore"
64
- - ".travis.yml"
65
64
  - Gemfile
66
- - LICENSE.txt
67
65
  - README.md
68
- - Rakefile
69
66
  - bin/enjoy_markov
70
67
  - enjoy_markov.gemspec
71
68
  - lib/enjoy_markov.rb
72
69
  - lib/enjoy_markov/version.rb
73
- - test/minitest_helper.rb
74
- - test/test_enjoy_markov.rb
75
70
  homepage: http://gogotanaka.me/
76
71
  licenses:
77
72
  - MIT
@@ -96,6 +91,4 @@ rubygems_version: 2.2.2
96
91
  signing_key:
97
92
  specification_version: 4
98
93
  summary: Enjoy markov process
99
- test_files:
100
- - test/minitest_helper.rb
101
- - test/test_enjoy_markov.rb
94
+ test_files: []
data/.travis.yml DELETED
@@ -1,3 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.1.2
data/LICENSE.txt DELETED
@@ -1,22 +0,0 @@
1
- Copyright (c) 2014 gogotanaka
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile DELETED
@@ -1,9 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rake/testtask"
3
-
4
- Rake::TestTask.new(:test) do |t|
5
- t.libs << "test"
6
- end
7
-
8
- task :default => :test
9
-
@@ -1,4 +0,0 @@
1
- $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
- require 'enjoy_markov'
3
-
4
- require 'minitest/autorun'
@@ -1,11 +0,0 @@
1
- require 'minitest_helper'
2
-
3
- class TestEnjoyMarkov < MiniTest::Unit::TestCase
4
- def test_that_it_has_a_version_number
5
- refute_nil ::EnjoyMarkov::VERSION
6
- end
7
-
8
- def test_it_does_something_useful
9
- assert false
10
- end
11
- end