Ruby SolutionsRuby Solutions
🎆
Happy New Year
Week 1, 2026
All Solutionsstraight forward, not very elegant solution | Lapizistik | Ruby Solutions
def fireworks(n, out: $stdout)
(n / 2).downto(1) do |i|
si = i - 1
out << ' ' * (n / 2 - i) << '\\' << ' ' * si << '|' << ' ' * si << '/' << "\n"
end
out << '-' * n << "\n"
1.upto(n / 2) do |i|
si = i - 1
out << ' ' * (n / 2 - i) << '/' << ' ' * si << '|' << ' ' * si << '\\' << "\n"
end
out
end