Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 24s
Counts primes <= 50, expected 15.
Stresses the recently-added Array module + the new array-indexing
syntax together with nested control flow:
let sieve = Array.make (n + 1) true in
sieve.(0) <- false;
sieve.(1) <- false;
for i = 2 to n do
if sieve.(i) then begin
let j = ref (i * i) in
while !j <= n do
sieve.(!j) <- false;
j := !j + i
done
end
done;
...
Exercises: Array.make, arr.(i), arr.(i) <- v, nested for/while,
begin..end blocks, ref/!/:=, integer arithmetic. 24 baseline
programs total.
29 lines
560 B
JSON
29 lines
560 B
JSON
{
|
|
"anagrams.ml": 3,
|
|
"bfs.ml": 6,
|
|
"btree.ml": 39,
|
|
"caesar.ml": 215,
|
|
"calc.ml": 13,
|
|
"closures.ml": 315,
|
|
"csv.ml": 10,
|
|
"exception_handle.ml": 4,
|
|
"expr_eval.ml": 16,
|
|
"factorial.ml": 3628800,
|
|
"frequency.ml": 5,
|
|
"fizzbuzz.ml": 57,
|
|
"list_ops.ml": 30,
|
|
"lambda_calc.ml": 7,
|
|
"levenshtein.ml": 11,
|
|
"memo_fib.ml": 75025,
|
|
"module_use.ml": 3,
|
|
"mutable_record.ml": 10,
|
|
"option_match.ml": 5,
|
|
"poly_stack.ml": 5,
|
|
"queens.ml": 2,
|
|
"quicksort.ml": 44,
|
|
"roman.ml": 44,
|
|
"sieve.ml": 15,
|
|
"sum_squares.ml": 385,
|
|
"word_count.ml": 3
|
|
}
|