[ create a new paste ] login | about

Link: http://codepad.org/baq0589i    [ raw code | output | fork ]

joshua_cheek - Ruby, pasted on Oct 21:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
puts "VERSION = #{VERSION}"

output = ['five','four','three','two','one','zero']
puts "Input Converted to:"
output=output.reverse

output.each do |text|
  puts text
end

puts

output.each_with_index do | text , index |
  puts "Index #{index} holds the value #{text}"
end


Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
VERSION = 1.8.6
Input Converted to:
zero
one
two
three
four
five

Index 0 holds the value zero
Index 1 holds the value one
Index 2 holds the value two
Index 3 holds the value three
Index 4 holds the value four
Index 5 holds the value five


Create a new paste based on this one


Comments: