This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[<ReflectedDefinition>] | |
module Fun3D | |
#if INTERACTIVE | |
#r "FunScript.dll" | |
#r "FunScript.Interop.dll" | |
#r "FunScript.TypeScript.Binding.lib.dll" | |
#r "FunScript.TypeScript.Binding.three.dll" | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#load "Fun3D.fsx" | |
open Fun3D | |
let head = | |
Fun.sphere | |
|> Fun.color Color.yellow | |
let hat = | |
Fun.cylinder | |
|> Fun.color Color.purple |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#load "Fun3D.fsx" | |
open Fun3D | |
let main() = | |
for z in 0..2 do | |
for i in 0 .. 5 do | |
Block.block(i, 0, -z, Block.crate) | |
Block.block(i, -5, -z, Block.crate) | |
Block.block(0, -i, -z, Block.crate) | |
Block.block(5, -i, -z, Block.crate) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Library | |
GraphicsWindow.BackgroundColor <- Colors.LawnGreen | |
GraphicsWindow.BrushColor <- Colors.Black | |
let w,h = float GraphicsWindow.Width, float GraphicsWindow.Height | |
let holeX, holeY = w/2.0, h/4.0 | |
GraphicsWindow.FillEllipse(holeX-20.,holeY-20.,40.,40.) | |
let mutable leftPressed,rightPressed,spacePressed = false, false, false | |
let pressed down = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "os" | |
import "fmt" | |
import "net/http" | |
import "io/ioutil" | |
import "encoding/json" | |
func getVersions(name string) []string { | |
url := fmt.Sprintf("https://www.nuget.org/api/v2/package-versions/%s",name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "os" | |
import "fmt" | |
import "net/http" | |
import "io" | |
func downloadPackage(name string) { | |
url := fmt.Sprintf("https://www.nuget.org/api/v2/package/%s",name) | |
resp, _ := http.Get(url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "os" | |
import "io" | |
import "fmt" | |
import "path" | |
import "net/http" | |
import "archive/zip" | |
func downloadPackage(name string) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"image" | |
"image/color" | |
"image/png" | |
"math" | |
"os" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"image" | |
"image/color" | |
"image/png" | |
"math" | |
"math/rand" | |
"os" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#r "PresentationCore.dll" | |
#r "PresentationFramework.dll" | |
#r "WindowsBase.dll" | |
#r "WriteableBitmapEx.Wpf.dll" // requires custom version with DrawString | |
open System | |
open System.Windows | |
open System.Windows.Controls | |
open System.Windows.Media | |
open System.Windows.Media.Imaging |