Skip to content

Conversation

@vologin-dmitry
Copy link
Owner

No description provided.

Copy link

@yurii-litvinov yurii-litvinov left a 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)*)

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

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

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)

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

Choose a reason for hiding this comment

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

Так упадёт, если number будет меньше 0

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)

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)

Copy link

@yurii-litvinov yurii-litvinov left a 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

Choose a reason for hiding this comment

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

А так он всегда Some возвращает, мог бы просто число возвращать

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