enjoy_markov 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/enjoy_markov/version.rb +1 -1
- data/lib/enjoy_markov.rb +15 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6c065a65983dda60d64aa6f0bba2f3d06eb56b6
|
4
|
+
data.tar.gz: 2b8262763ad810e61f9b751791f7d60a17e29152
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98179eed00b2756a65d29da24d8309065e8e8ebfcd77bfbca139bd549a6900e968bde0c1ebca814f96aca57035fc637905d54510814d6ebd94b32451f2a22eca
|
7
|
+
data.tar.gz: a987b60ae49423f8a909d9e11f10e12cc7eb58e993cd4fabb5809ef581360ca178571895d0219b85a49669d6cd89b55fec302334ae4074dab47275c432c7f0a5
|
data/lib/enjoy_markov/version.rb
CHANGED
data/lib/enjoy_markov.rb
CHANGED
@@ -1,11 +1,19 @@
|
|
1
1
|
class EnjoyMarkov
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
2
|
+
class << self
|
3
|
+
def start!(supinf=20)
|
4
|
+
@@x = 0
|
5
|
+
loop do
|
6
|
+
@@x += [-1, 1].sample # TODO: use prefer randmGen
|
7
|
+
raise 'ops.. ;(' if supinf == @@x.abs
|
8
|
+
puts "#{wall}#{space * supinf}#{axis}#{space * supinf}#{wall}".tap { |s| s[@@x + supinf + 1] = point }
|
9
|
+
sleep 0.05
|
10
|
+
end
|
9
11
|
end
|
12
|
+
|
13
|
+
private
|
14
|
+
def axis; "|" end
|
15
|
+
def wall; "|" end
|
16
|
+
def point; "\e[31m*\e[0m" end
|
17
|
+
def space; "\s" end
|
10
18
|
end
|
11
19
|
end
|