From 4432aec37d039fea58d22b6623ecbebc0457c30e Mon Sep 17 00:00:00 2001 From: Nacho Date: Sun, 13 Sep 2026 17:21:09 -0300 Subject: [PATCH] Add examples of loops in Ruby using times and each --- bucles.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 bucles.rb diff --git a/bucles.rb b/bucles.rb new file mode 100644 index 0000000..f427eb7 --- /dev/null +++ b/bucles.rb @@ -0,0 +1,10 @@ +# bucles.rb +# Ejemplo usando 'times' (muy característico de Ruby) +5.times do |i| + puts "Esta es la repetición número #{i + 1}" +end + +# Ejemplo iterando sobre un rango con 'each' +(1..5).each do |numero| + puts "Número de rango: #{numero}" +end