Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
FizzBuzz without Modulo in F#
// FizzBuzz without Modulo in F# // http://functionalsoftware.net/yet-another-fizz-buzz-yafb-in-fsharp-551/ let cycle x = Seq.initInfinite (fun _ -> x) |> Seq.concat let zipWith f xs ys = Seq.zip xs ys |> Seq.map (fun (x,y) -> f x y) let numbers = seq [1 .. 100] |> Seq.map string let fizz = seq ["";"";"fizz"] |> cycle let buzz = seq ["";"";"";"";"buzz"] |> cycle let fizzBuzz = zipWith (+) fizz buzz |> zipWith max numbers let result = fizzBuzz |> Seq.take 100 |> Seq.toList printfn "%A" result
run
|
edit
|
history
|
help
0
lab 1
Split list without mutable values
Average Square Error
Map.except
Give F# Some Love!
F#: Basic Immutability vs. Mutability
Sending an email
Calculate distance between two GPS latitude-longitude points.
Yet another Fibonacci
The wonders of F#