-
Notifications
You must be signed in to change notification settings - Fork 0
Hometask 1 #1
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?
Hometask 1 #1
Conversation
Task 3
Outdated
| @@ -0,0 +1,5 @@ | |||
| class Task3 | |||
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.
You wrap your code in class, but you don't use Task3 object at all. You can place that code inside class method and then call it in the end of this file. Or you can simply remove class construction, it is okay for this task.
Task 3
Outdated
| @@ -0,0 +1,5 @@ | |||
| class Task3 | |||
| array1 = ["apple", "onion", "orange"] | |||
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.
task says “script takes”, it means that your script should take this arrays as arguments from STDIN
| @@ -1,6 +1,6 @@ | |||
| class New | |||
| def task | |||
| myArray = ["stuff", "widget", "ruby", "goodies", "java", "emerald", "etc" ] | |||
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.
this is 7th task, rename please file
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.
- You changed name of this file, but please add comment here that you made modifications
- Move all files to one directory called "Ruby Basic" or something like that
| item = myArray[rand(myArray.length)] | ||
| end | ||
| 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.
if you want to execute this code, you should call method task
| number / other | ||
| end | ||
| end | ||
| calculator = Numbers.new |
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.
In example to task 6 you can see next Input example: ruby yourscript.rb 5 10 sum. So you need to give argument to this script (two numbers and operation name).
| @@ -1,6 +1,6 @@ | |||
| class New | |||
| def task | |||
| myArray = ["stuff", "widget", "ruby", "goodies", "java", "emerald", "etc" ] | |||
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.
this script must take arguments from outside (ARGV), so you should give these argument when you call this script
| @@ -0,0 +1,6 @@ | |||
| class Home | |||
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.
This is wrong realization of task. The script should take the NAME OF TEXT FILE and the LINE.
| puts item | ||
| end | ||
| end | ||
| a = New.new |
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.
you should create instance outside of class body
No description provided.