nyancat 0.0.1 → 0.0.2
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.
- data/lib/nyancat.rb +22 -18
- metadata +5 -5
data/lib/nyancat.rb
CHANGED
@@ -832,17 +832,17 @@ class NyanCat
|
|
832
832
|
',' => "\033[48;5;17m",
|
833
833
|
'.' => "\033[48;5;15m",
|
834
834
|
'\'' => "\033[48;5;0m",
|
835
|
-
'@' => "\033[48;5;
|
836
|
-
'$' => "\033[48;5;
|
837
|
-
'-' => "\033[48;5;
|
838
|
-
'>' => "\033[48;5;
|
839
|
-
'&' => "\033[48;5;
|
840
|
-
'+' => "\033[48;5;
|
841
|
-
'#' => "\033[48;5;
|
842
|
-
'=' => "\033[48;5;
|
843
|
-
';' => "\033[48;5;
|
844
|
-
'*' => "\033[48;5;
|
845
|
-
'%' => "\033[48;5;
|
835
|
+
'@' => "\033[48;5;223m",
|
836
|
+
'$' => "\033[48;5;219m",
|
837
|
+
'-' => "\033[48;5;205m",
|
838
|
+
'>' => "\033[48;5;196m",
|
839
|
+
'&' => "\033[48;5;214m",
|
840
|
+
'+' => "\033[48;5;226m",
|
841
|
+
'#' => "\033[48;5;82m",
|
842
|
+
'=' => "\033[48;5;39m",
|
843
|
+
';' => "\033[48;5;99m",
|
844
|
+
'*' => "\033[48;5;245m",
|
845
|
+
'%' => "\033[48;5;217m",
|
846
846
|
}
|
847
847
|
|
848
848
|
# Set output character
|
@@ -865,15 +865,19 @@ class NyanCat
|
|
865
865
|
min_col = (max_col - term_width) / 2 if max_col > term_width
|
866
866
|
max_col = min_col + term_width if max_col > term_width
|
867
867
|
|
868
|
+
frames = frames.map do |frame|
|
869
|
+
frame[min_row...max_row].map do |line|
|
870
|
+
line.chars.to_a[min_col...max_col].map do |c|
|
871
|
+
"%s%s" % [colours[c], output]
|
872
|
+
end.join + "\033[m\n"
|
873
|
+
end.join + "\033[H"
|
874
|
+
end
|
875
|
+
|
868
876
|
printf("\033[H\033[2J\033[?25l")
|
869
877
|
begin
|
870
|
-
|
871
|
-
frames.each do |frame|
|
872
|
-
frame
|
873
|
-
line[min_col..max_col-1].each_char { |c| printf("%s%s", colours[c], output) }
|
874
|
-
printf("\033[m\n")
|
875
|
-
end
|
876
|
-
printf("\033[H")
|
878
|
+
loop do
|
879
|
+
frames.each do |frame|
|
880
|
+
print frame
|
877
881
|
sleep(0.09)
|
878
882
|
end
|
879
883
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nyancat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ben Arblaster
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-12-
|
18
|
+
date: 2011-12-05 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -63,6 +63,6 @@ rubyforge_project:
|
|
63
63
|
rubygems_version: 1.3.7
|
64
64
|
signing_key:
|
65
65
|
specification_version: 3
|
66
|
-
summary: nyancat
|
66
|
+
summary: nyancat on your terminal
|
67
67
|
test_files: []
|
68
68
|
|