Решение на Пета задача от Методи Димитров

Обратно към всички решения

Към профила на Методи Димитров

Резултати

  • 0 точки от тестове
  • 0 бонус точки
  • 0 точки общо
  • 0 успешни тест(а)
  • 0 неуспешни тест(а)

Код

REPOSITORY = 'https://github.com/meanmachine/ruby-retrospective-3'
# Lessons learned
#
# 1. When using Array#map, there is no need of Array#each to cycle through
# elements.
# 2. Instead of creating Array with two elements (Array1 and Array2) and calling
# #transpose, just use Array#zip on Array1 and Array2
# 3. Separating digits of number can be done by converting number to string and
# using String#split, instead of recursively applying arithmetic operations
# to get each digit.
# 4. Instead of comparing Number.pred with 2, I can compare Number with 3 and
# reduce logic
# 5. Never include Module right after Module's definition itself.
# 6. If class method has same name as class, prefer #self, when declaring it.

История (1 версия и 1 коментар)

Методи обнови решението на 22.01.2014 13:00 (преди почти 11 години)

+REPOSITORY = 'https://github.com/meanmachine/ruby-retrospective-3'
+
+# Lessons learned
+#
+# 1. When using Array#map, there is no need of Array#each to cycle through
+# elements.
+# 2. Instead of creating Array with two elements (Array1 and Array2) and calling
+# #transpose, just use Array#zip on Array1 and Array2
+# 3. Separating digits of number can be done by converting number to string and
+# using String#split, instead of recursively applying arithmetic operations
+# to get each digit.
+# 4. Instead of comparing Number.pred with 2, I can compare Number with 3 and
+# reduce logic
+# 5. Never include Module right after Module's definition itself.
+# 6. If class method has same name as class, prefer #self, when declaring it.

За съжаление не можеш да получиш точки, понеже някои от тестовете ти не минават, а и не си завършил решенията си и двадесетте неща, предполагам поради недостиг на време. Надявам се, че въпреки това си научил интересни неща.