Skip to content

Instantly share code, notes, and snippets.

@ajtran303
Created May 7, 2020 03:10
Show Gist options
  • Save ajtran303/5483f5332b215d87c85e44a731a9af9f to your computer and use it in GitHub Desktop.
Save ajtran303/5483f5332b215d87c85e44a731a9af9f to your computer and use it in GitHub Desktop.
Ruby Loops
```ruby
3.times { print "Beetlejuice " }
counter = 3
while counter > 0
print "Beetlejuice "
counter -= 1
end
counter = 3
until counter == 0
print "Beetlejuice "
counter -= 1
end
counter = 3
loop do
print "Beetlejuice "
counter -= 1
if count == 0
break
end
end
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment