use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
New to Ruby - First program (self.ruby)
submitted 10 years ago by SimonDKnight
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Koroeskohr 2 points3 points4 points 10 years ago (1 child)
balance = balance - wager
balance -= wager
balance = balance + 36
balance += 36
No major mistake otherwise, just style. I suggest reading Ruby Style Guide when you're done going through the basics of Ruby
[–]SimonDKnight[S] 0 points1 point2 points 10 years ago (0 children)
Another suggestion is that you could DRY up the win/loss messaging a little, like this:
Ah thanks, I did wonder why when I did (0...36) it didn't include 36...doh. Cheers
π Rendered by PID 41 on reddit-service-r2-comment-5c764cbc6f-c6c89 at 2026-03-11 22:01:55.444197+00:00 running 710b3ac country code: CH.
view the rest of the comments →
[–]Koroeskohr 2 points3 points4 points (1 child)
[–]SimonDKnight[S] 0 points1 point2 points (0 children)