Open
Conversation
DedSec256
reviewed
May 6, 2024
| let countSumFibEven () = | ||
| let rec countSum n1 n2 sum = | ||
| match n1 with | ||
| | (n : int) when (n >= 1000000) -> sum |
Comment on lines
+9
to
+10
| | (n : int) when (n % 2 = 0) -> countSum n2 (n2 + n1) sum | ||
| | _ -> countSum n2 (n2 + n1) (sum + n1) |
There was a problem hiding this comment.
можно объединить ветки, разделив только логику вычисления аккумулятора
| countSumFibEven() |> should equal 1089154 | ||
|
|
||
| let squaresCases = | ||
| seq{ |
| open ProgressCheck1.PriorityQueue | ||
|
|
||
| [<Test>] | ||
| let TestFibonachi () = |
|
|
||
| module PriorityQueue = | ||
|
|
||
| type PriorityQueue<'T>(comparer : 'T -> 'T -> int) = |
|
|
||
| let rec makeInnerString str iter n = | ||
| match iter with | ||
| | (p : int) when (p = n) -> str |
There was a problem hiding this comment.
Тут тоже типы несколько излишни. Справедливости ради, тут и match излишний, тут структурного сопоставления нигде не делается. Это лучше было бы записать как цепочку if-ов, хотя дело вкуса
|
|
||
| module PrintSquare = | ||
|
|
||
| let PrintSquare n = |
There was a problem hiding this comment.
Функции в модулях по традиции именуются со строчной, и тут тоже надо комментарии по-хорошему
DedSec256
reviewed
May 16, 2024
| let lockObject = obj | ||
|
|
||
| member this.Clear() = | ||
| items <- [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.