Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
pooriar
· 2y ago · 0 comments
Same as this?
(1..20).each do |i| puts i if i.odd? || i.prime? end
edit - upon testing, I just realized the parent's code prints 10 & 16, my code does not, so not the same.
Comments
[–]
codesnik
2y ago
flipflop basically has a hidden boolean variable for state. Btw, while I HAD used it, i still have no idea what's the scope of that state and when it'd reset itself.