Skip to content

Homework1.Svyryda.rb#28

Open
zoroksana wants to merge 3 commits intopivorakcourse:masterfrom
zoroksana:patch-1
Open

Homework1.Svyryda.rb#28
zoroksana wants to merge 3 commits intopivorakcourse:masterfrom
zoroksana:patch-1

Conversation

@zoroksana
Copy link
Copy Markdown

Svyryda.homework1.pull request

homework.rb Outdated
def generate
# put your solution here (delete the line below)
rand(1000000).to_s + '-' + rand(1000000).to_s
a, b, c = rand(1000...9999), rand(1000...9999), rand(1000...9999)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It's not the ruby way to name variables likes that: a, b, c, x, y.
Name of variable should explain content or describe appointment

use something like first_part, etc

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Also you 3 times called rand(1000...9999). What about some DRY (don't repeat yourself) ?

Correcting mistakes. Is it right?
change homework 1
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