A generalised version of the solution to the fourth Project Euler problem - Largest palindrome product, using sequences. The key to understanding this code is how "Seq.map (fun x -> (Seq.map (fun y -> x * y) baseSeq)) baseSeq" generates a sequence of sequences that contains the products of all possible combinations of two n-digit numbers. "Seq.map (fun x -> (Seq.map (fun y -> x * y) {1..3})) {1..3}" will generate: seq [seq [1; 2; 3]; seq [2; 4; 6]; seq [3; 6; 9]]
0 people like thisPosted: 9 years ago by Bjørn Bæverfjord
Several ways of counting leading zeros in a binary number. Update: clzDeBruijn now captures the look-up table in the closure so that the table is only evaluated once and everything is contained in the main function.
3 people like thisPosted: 9 years ago by Bjørn Bæverfjord
Prototype of a CIL code optimizer that generates optimal code for bitwise functions. Update: General improvements
2 people like thisPosted: 7 years ago by Bjørn Bæverfjord
Cleaning up source code for a Forth like language before the compiling stage
1 people like thisPosted: 9 years ago by Bjørn Bæverfjord
Creates a map containing each item and its frequency as a key/value pair. Then sort by value in reverse order before printing each item.
1 people like thisPosted: 8 years ago by Bjørn Bæverfjord
A simple way to render the F# logo with integer scaling to avoid aliasing
4 people like thisPosted: 6 years ago by Bjørn Bæverfjord