Permalink
Browse files

Update to v0.0.5

  • Loading branch information...
nelbren committed Oct 23, 2018
1 parent b837bb1 commit 64ac756c6bbc6f16a9fe4fca47bfdb74a187b86b
Showing with 11 additions and 17 deletions.
  1. +8 −14 heart.rb
  2. +3 −3 string_rotations.rb
@@ -1,22 +1,16 @@
#!/usr/bin/ruby #!/usr/bin/ruby
# heart.ruby v0.0.4 # heart.ruby v0.0.5
# nelbren@gmail.com # nelbren@gmail.com
# Use: ShortBlocks2 # Use: Case 2 Array
@a = ['','','','','','','',''] @a = ['','','','','','','','']
@rc = [ [1,4], [0,5], [1,6] ]
8.times do |r| 8.times do |r|
case r if r > 2
when 0 @cb += 1
@cb = 1 else
@ce = 4 @cb = @rc[r][0]
when 1 @ce = @rc[r][1]
@cb = 0
@ce = 5
when 2
@cb = 1
@ce = 6
else
@cb = @cb + 1
end end
7.times { |c| @a[r] += (@cb..@ce).include?(c) ? 'x' : ' ' } 7.times { |c| @a[r] += (@cb..@ce).include?(c) ? 'x' : ' ' }
end end
@@ -1,5 +1,5 @@
#!/usr/bin/ruby #!/usr/bin/ruby
# string_rotations_v0.0.4.rb # string_rotations_v0.0.5.rb
# nelbren@nelbren.com # nelbren@nelbren.com
# UsingSubstringAndOnlyOneAssing # UsingSubstringAndOnlyOneAssingInside
a=[];(x=gets.chomp).each_char{|c|x=x[1..-1]+c;a<<x};p a a=[];(x=gets.chomp).each_char{|c|a<<(x=x[1..-1]+c)};p a

0 comments on commit 64ac756

Please sign in to comment.