-
Couldn't load subscription status.
- Fork 74
Tasks are done #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Tasks are done #4
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! one small issue with leap_year
| @@ -0,0 +1,19 @@ | |||
| def add_up(i) | |||
| if (i.class !=Integer) || (i <1) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice validation!
| puts sum | ||
| end | ||
| end | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation is a bit off
| @@ -0,0 +1,15 @@ | |||
| def Ask(question) | |||
| puts question | |||
| string = gets.chomp + " " | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather than adding a space to the end of the word here I would probably wait till the end of the method and just use join(' ')
| full_name.push(Ask("Enter your middle name, please")) | ||
| full_name.push(Ask("Enter your last name please")) | ||
|
|
||
| puts "Hello " + full_name[0] + full_name[1] + full_name[2] + "!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorta same as the above, I would use full_name.join(' ')
| end | ||
| end | ||
|
|
||
| year = begin_year |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure what this line is doing. begin_year is not defined at this point
| @@ -0,0 +1,15 @@ | |||
| words = [] | |||
|
|
|||
| while true do | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I try to avoid using while true loops, because then if any of the branches within that loop do not break correctly you end up with an infinite loop, which is no good
| word = gets.chomp | ||
| if word == '' | ||
| break | ||
| elsif word.index(/[^A-Za-z]/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good validation!
No description provided.