Skip to content

Sockets - Karla#32

Open
kguadron wants to merge 1 commit intoAda-C11:masterfrom
kguadron:master
Open

Sockets - Karla#32
kguadron wants to merge 1 commit intoAda-C11:masterfrom
kguadron:master

Conversation

@kguadron
Copy link
Copy Markdown

No description provided.

Comment thread lib/factorial.rb
def factorial(number)
raise NotImplementedError
raise ArgumentError if number.nil?
return 1 if number == 0 || number == 1
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice handling of base cases up front.

Comment thread lib/factorial.rb
i -= 1
number = number * i
end
return number
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great solution! Maybe i could be renamed as factorial? It might make it easier to read.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants