F #: a very beautiful example using DirectX

    I wanted to make a link, but the text does not fit in 500 characters ...
    So, F # is a new language in the .NET line, a functional programming language. Soshnikov D.V. on platforma2009 at the end of the report shows a very interesting and beautiful example of using F #, plotting functions (depending on time!) and launching rolling balls on the surfaces of the graphs. You can take this example here , the only thing you need to do is flip it a bit under the current version of F # CTP 1.9.6.2. 1.


    #I @ "C: \ WINDOWS \ Microsoft.NET \ Managed DirectX \ v9.02.2904" ;; you need to replace with your installed version of DirecX (SDK), I had it in #I @ "C: \ Windows \ Microsoft.NET \ DirectX for Managed Code \ 1.0.2902.0" ;; (you, I think, will be lying in the same place, the only thing is the version difference - the last digits)
    2. Add reference to the assembly:
    #r "FSharp.PowerPack.dll" ;;
    #r "FSharp.Core.dll" ;;
    3. Replace
    open Idioms
    open Compatibility 
    open List
    with
    open Microsoft.FSharp.Collections.List
    4.In line 285, I had to add parameterization in the function let meshGet mesh (i, j) = let X, Y = mesh in X. (i, j), Y. (i, j) and it began to look like let meshGet mesh (i, j) = let (X: float [,], Y: float [,]) = mesh in X. [i, j], Y. [i, j]
    5. On line 307 we again remove open Idioms and open List
    6 . On line 334, change let (doDrawScene, drawScene): event = IEvent.create () to let (doDrawScene, drawScene): event

    Also popular now: