Permalink
Browse files

Update to v0.0.9

  • Loading branch information...
nelbren committed Oct 23, 2018
1 parent 9f7d1e2 commit 5a3e08868a7b381d43fa04ea857841a13675244c
Showing with 4 additions and 8 deletions.
  1. +4 −8 heart.rb
@@ -1,18 +1,14 @@
#!/usr/bin/ruby
# heart.ruby v0.0.8
# heart.ruby v0.0.9
# nelbren@gmail.com
# Array2NewAssign''
# ReplaceIfForTwoIf
a = Array.new(8, '')
rc = [ [1,4], [0,5], [1,6] ]
cb,ce = 0
8.times do |r|
if r > 2
cb += 1
else
cb,ce = rc[r][0],rc[r][1]
end
cb += 1 if r > 2
cb,ce = rc[r][0],rc[r][1] if r <= 2
7.times { |c| a[r] += (cb..ce).include?(c) ? 'x' : ' ' }
end
a.each { |r| p r + r.reverse }

0 comments on commit 5a3e088

Please sign in to comment.