Skip to content

ProgressCheck1#6

Open
AnNyiiik wants to merge 6 commits intomainfrom
ProgressCheck
Open

ProgressCheck1#6
AnNyiiik wants to merge 6 commits intomainfrom
ProgressCheck

Conversation

@AnNyiiik
Copy link
Owner

No description provided.

let countSumFibEven () =
let rec countSum n1 n2 sum =
match n1 with
| (n : int) when (n >= 1000000) -> sum

Choose a reason for hiding this comment

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

тут необязательно указывать типы

Comment on lines +9 to +10
| (n : int) when (n % 2 = 0) -> countSum n2 (n2 + n1) sum
| _ -> countSum n2 (n2 + n1) (sum + n1)

Choose a reason for hiding this comment

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

можно объединить ветки, разделив только логику вычисления аккумулятора

countSumFibEven() |> should equal 1089154

let squaresCases =
seq{

Choose a reason for hiding this comment

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

Suggested change
seq{
seq {

open ProgressCheck1.PriorityQueue

[<Test>]
let TestFibonachi () =

Choose a reason for hiding this comment

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

Он Fibonacci на самом деле


module PriorityQueue =

type PriorityQueue<'T>(comparer : 'T -> 'T -> int) =

Choose a reason for hiding this comment

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

Как обычно, надо комментарии


let rec makeInnerString str iter n =
match iter with
| (p : int) when (p = n) -> str

Choose a reason for hiding this comment

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

Тут тоже типы несколько излишни. Справедливости ради, тут и match излишний, тут структурного сопоставления нигде не делается. Это лучше было бы записать как цепочку if-ов, хотя дело вкуса


module PrintSquare =

let PrintSquare n =

Choose a reason for hiding this comment

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

Функции в модулях по традиции именуются со строчной, и тут тоже надо комментарии по-хорошему

let lockObject = obj

member this.Clear() =
items <- []

Choose a reason for hiding this comment

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

Так же нужно обернуть в lock

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.

3 participants