-
Notifications
You must be signed in to change notification settings - Fork 0
Full first homework #60
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?
Conversation
yurii-litvinov
left a comment
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.
В целом всё ок. Давайте факториал надо будет поправить, остальные зачтены
| Assert.Throws<System.NullReferenceException>(factorial -100) | ||
| Assert.AreEqual(factorial -100, None) | ||
| Assert.AreEqual(factorial -1, None) | ||
| Assert.AreEqual(factorial -1024124, None)*) |
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.
Закомментированный код не нужен, а вот негативные тесты нужны
| Assert.AreEqual(0, fibonacci 0) | ||
| Assert.AreEqual(1, fibonacci 1) | ||
| Assert.AreEqual(5, fibonacci 5) | ||
| Assert.AreEqual(55, fibonacci 10) No newline at end of 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.
И тут надо бы добавить негативности
| @@ -0,0 +1 @@ | |||
| module Program = let [<EntryPoint>] main _ = 0 | |||
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.
Пустой main указывает на то, что Вы хотели <OutputType>Library</OutputType> в проектном файле
| else if (number = i) then | ||
| Some(acc * number) | ||
| else | ||
| factorialHelper (i+1) (acc*i) |
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.
Пробелов не хватает, в F# бинарные операции всё так же окружаются пробелами
| else | ||
| factorialHelper (i+1) (acc*i) | ||
|
|
||
| (factorialHelper 1 1).Value No newline at end of 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.
Так упадёт, если number будет меньше 0
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.
А так он всегда Some возвращает, мог бы просто число возвращать
| else if List.head list = toFind then | ||
| Some(position) | ||
| else | ||
| firstMatchHelper(List.tail list)(position + 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.
И тут надо пробелы, так: firstMatchHelper (List.tail list) (position + 1)
yurii-litvinov
left a comment
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 enough, зачтена
| else | ||
| factorialHelper (i+1) (acc*i) | ||
|
|
||
| (factorialHelper 1 1).Value No newline at end of 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.
А так он всегда Some возвращает, мог бы просто число возвращать
No description provided.