PacMan Maze

PacMan maze view runnable inside TryFSharp.org

Copy Source
Copy Link
Tools:
  1: Skip namespace definition on TryFSharp.org
  2: 
  3: open System
  4: open System.Windows
  5: open System.Windows.Controls
  6: open System.Windows.Media
  7: open System.Windows.Media.Imaging
  8: 
  9: type GameControl() as this = 
 10:     inherit UserControl()
 11:     let maze = "
 12: /------------7/------------7
 13: |............|!............|
 14: |./__7./___7.|!./___7./__7.|
 15: |o|  !.|   !.|!.|   !.|  !o|
 16: |.L--J.L---J.LJ.L---J.L--J.|
 17: |..........................|
 18: |./__7./7./______7./7./__7.|
 19: |.L--J.|!.L--7/--J.|!.L--J.|
 20: |......|!....|!....|!......|
 21: L____7.|L__7 |! /__J!./____J
 22: #####!.|/--J LJ L--7!.|#####
 23: #####!.|!          |!.|#####
 24: #####!.|! /__==__7 |!.|#####
 25: -----J.LJ |      ! LJ.L-----
 26: ##### .   |      !   . #####
 27: _____7./7 |      ! /7./_____
 28: #####!.|! L______J |!.|#####
 29: #####!.|!          |!.|#####
 30: #####!.|! /______7 |!.|#####
 31: /----J.LJ L--7/--J LJ.L----7
 32: |............|!............|
 33: |./__7./___7.|!./___7./__7.|
 34: |.L-7!.L---J.LJ.L---J.|/-J.|
 35: |o..|!.......<>.......|!..o|
 36: L_7.|!./7./______7./7.|!./_J
 37: /-J.LJ.|!.L--7/--J.|!.LJ.L-7
 38: |......|!....|!....|!......|
 39: |./____JL__7.|!./__JL____7.|
 40: |.L--------J.LJ.L--------J.|
 41: |..........................|
 42: L--------------------------J"
 43: 
 44:     let toInt (color:Color) = 
 45:         (int color.A <<< 24) ||| 
 46:         (int color.R <<< 16) ||| 
 47:         (int color.G <<< 8)  ||| 
 48:         int color.B
 49:     let toBitmap color (xs:int list) =
 50:         let width = 8
 51:         let white = color |> toInt
 52:         let black = 0x00000000
 53:         let toColor = function true -> white | false -> black
 54:         let bitmap = WriteableBitmap(width, xs.Length)
 55:         let pixels = bitmap.Pixels
 56:         xs |> List.iteri (fun y xs ->
 57:             for x = 0 to width-1 do
 58:                 let bit = 1 <<< (width - 1 - x) 
 59:                 pixels.[x+y*width] <- xs &&& bit = bit |> toColor
 60:         )
 61:         bitmap
 62:     let toImage (bitmap:#BitmapSource) =
 63:         let w = bitmap.GetValue(BitmapSource.PixelWidthProperty) :?> int
 64:         let h = bitmap.GetValue(BitmapSource.PixelHeightProperty) :?> int
 65:         Image(Source=bitmap,Stretch=Stretch.Fill,Width=float w,Height=float h) 
 66: 
 67:     let tops = [
 68:         0b00000000, 0b00000000, 0b00000000
 69:         0b00000000, 0b00000000, 0b00000000
 70:         0b00000000, 0b00000000, 0b00000000
 71:         0b00000000, 0b00000000, 0b00000000
 72:         0b00000011, 0b11111111, 0b11000000
 73:         0b00000100, 0b00000000, 0b00100000
 74:         0b00001000, 0b00000000, 0b00010000
 75:         0b00001000, 0b00000000, 0b00010000]
 76:     let mids = [
 77:         0b00001000, 0b00000000, 0b00010000
 78:         0b00001000, 0b00000000, 0b00010000
 79:         0b00001000, 0b00000000, 0b00010000
 80:         0b00001000, 0b00000000, 0b00010000
 81:         0b00001000, 0b00000000, 0b00010000
 82:         0b00001000, 0b00000000, 0b00010000
 83:         0b00001000, 0b00000000, 0b00010000
 84:         0b00001000, 0b00000000, 0b00010000]
 85:     let bots = [
 86:         0b00001000, 0b00000000, 0b00010000
 87:         0b00001000, 0b00000000, 0b00010000
 88:         0b00000100, 0b00000000, 0b00100000
 89:         0b00000011, 0b11111111, 0b11000000
 90:         0b00000000, 0b00000000, 0b00000000
 91:         0b00000000, 0b00000000, 0b00000000
 92:         0b00000000, 0b00000000, 0b00000000
 93:         0b00000000, 0b00000000, 0b00000000]
 94:     let pill' = [
 95:         0b00000000
 96:         0b00000000
 97:         0b00000000
 98:         0b00011000
 99:         0b00011000
100:         0b00000000
101:         0b00000000
102:         0b00000000]
103:     let power' = [
104:         0b00000000
105:         0b00011000
106:         0b00111100
107:         0b01111110
108:         0b01111110
109:         0b00111100
110:         0b00011000
111:         0b00000000]
112: 
113:     let fromTriple xs = 
114:         let convert = toBitmap Colors.Blue
115:         List.foldBack (fun (l,m,r) (ls,ms,rs) -> l::ls, m::ms, r::rs) xs ([],[],[])
116:         |> fun (l,m,r) -> convert l, convert m, convert r
117: 
118:     let tl, top, tr         = fromTriple tops
119:     let left, blank, right  = fromTriple mids
120:     let bl, bottom, br      = fromTriple bots
121:     let pill = toBitmap Colors.Yellow pill'
122:     let power = toBitmap Colors.Yellow power'
123: 
124:     let toTile c =
125:         match c with
126:         | '='
127:         | '_' -> top
128:         | '|' -> left
129:         | '!' -> right
130:         | '/' -> tl
131:         | '7' -> tr
132:         | 'L' -> bl
133:         | 'J' -> br
134:         | '-' -> bottom
135:         | '.' -> pill
136:         | 'o' -> power
137:         | _ -> blank
138: 
139:     let canvas = Canvas(Background = SolidColorBrush Colors.Black)
140:     do  this.Content <- canvas
141:     let lines = maze.Split('\n')
142:     do  lines |> Array.iteri (fun y line ->
143:             line |> Seq.iteri (fun x item ->
144:                 let tile = toTile item |> toImage
145:                 Canvas.SetLeft(tile, x * 8 |> float)
146:                 Canvas.SetTop(tile, y * 8 |> float)
147:                 canvas.Children.Add tile |> ignore
148:             )
149:         )
150: 
151: Run script on TryFSharp.org
#if INTERACTIVE
#else
namespace PacMan
#endif
namespace System
namespace System.Windows
namespace System.Windows.Controls
namespace System.Windows.Media
namespace System.Windows.Media.Imaging
type GameControl =
  class
    inherit UserControl
    new : unit -> GameControl
  end

Full name: Snippet.GameControl

  type: GameControl
  implements: Composition.DUCE.IResource
  implements: Animation.IAnimatable
  implements: IFrameworkInputElement
  implements: IInputElement
  implements: ComponentModel.ISupportInitialize
  implements: Markup.IHaveResources
  implements: Markup.IQueryAmbient
  implements: Markup.IAddChild
  inherits: UserControl
  inherits: ContentControl
  inherits: Control
  inherits: FrameworkElement
  inherits: UIElement
  inherits: Visual
  inherits: DependencyObject
  inherits: Threading.DispatcherObject
val this : GameControl

  type: GameControl
  implements: Composition.DUCE.IResource
  implements: Animation.IAnimatable
  implements: IFrameworkInputElement
  implements: IInputElement
  implements: ComponentModel.ISupportInitialize
  implements: Markup.IHaveResources
  implements: Markup.IQueryAmbient
  implements: Markup.IAddChild
  inherits: UserControl
  inherits: ContentControl
  inherits: Control
  inherits: FrameworkElement
  inherits: UIElement
  inherits: Visual
  inherits: DependencyObject
  inherits: Threading.DispatcherObject
type UserControl =
  class
    inherit System.Windows.Controls.ContentControl
    new : unit -> System.Windows.Controls.UserControl
  end

Full name: System.Windows.Controls.UserControl

  type: UserControl
  implements: Composition.DUCE.IResource
  implements: Animation.IAnimatable
  implements: IFrameworkInputElement
  implements: IInputElement
  implements: ComponentModel.ISupportInitialize
  implements: Markup.IHaveResources
  implements: Markup.IQueryAmbient
  implements: Markup.IAddChild
  inherits: ContentControl
  inherits: Control
  inherits: FrameworkElement
  inherits: UIElement
  inherits: Visual
  inherits: DependencyObject
  inherits: Threading.DispatcherObject
val maze : string

  type: string
  implements: IComparable
  implements: ICloneable
  implements: IConvertible
  implements: IComparable<string>
  implements: seq<char>
  implements: Collections.IEnumerable
  implements: IEquatable<string>
val toInt : (Color -> int)
val color : Color

  type: Color
  implements: IFormattable
  implements: IEquatable<Color>
  inherits: ValueType
type Color =
  struct
    member A : System.Byte with get, set
    member B : System.Byte with get, set
    member Clamp : unit -> unit
    member ColorContext : System.Windows.Media.ColorContext
    member Equals : System.Windows.Media.Color -> bool
    member Equals : obj -> bool
    member G : System.Byte with get, set
    member GetHashCode : unit -> int
    member GetNativeColorValues : unit -> float32 []
    member R : System.Byte with get, set
    member ScA : float32 with get, set
    member ScB : float32 with get, set
    member ScG : float32 with get, set
    member ScR : float32 with get, set
    member ToString : unit -> string
    member ToString : System.IFormatProvider -> string
    static member Add : System.Windows.Media.Color * System.Windows.Media.Color -> System.Windows.Media.Color
    static member AreClose : System.Windows.Media.Color * System.Windows.Media.Color -> bool
    static member Equals : System.Windows.Media.Color * System.Windows.Media.Color -> bool
    static member FromAValues : float32 * float32 [] * System.Uri -> System.Windows.Media.Color
    static member FromArgb : System.Byte * System.Byte * System.Byte * System.Byte -> System.Windows.Media.Color
    static member FromRgb : System.Byte * System.Byte * System.Byte -> System.Windows.Media.Color
    static member FromScRgb : float32 * float32 * float32 * float32 -> System.Windows.Media.Color
    static member FromValues : float32 [] * System.Uri -> System.Windows.Media.Color
    static member Multiply : System.Windows.Media.Color * float32 -> System.Windows.Media.Color
    static member Subtract : System.Windows.Media.Color * System.Windows.Media.Color -> System.Windows.Media.Color
  end

Full name: System.Windows.Media.Color

  type: Color
  implements: IFormattable
  implements: IEquatable<Color>
  inherits: ValueType
Multiple items
val int : 'T -> int (requires member op_Explicit)

Full name: Microsoft.FSharp.Core.Operators.int

--------------------

type int<'Measure> = int

Full name: Microsoft.FSharp.Core.int<_>

  type: int<'Measure>
  implements: IComparable
  implements: IConvertible
  implements: IFormattable
  implements: IComparable<int<'Measure>>
  implements: IEquatable<int<'Measure>>
  inherits: ValueType


--------------------

type int = int32

Full name: Microsoft.FSharp.Core.int

  type: int
  implements: IComparable
  implements: IFormattable
  implements: IConvertible
  implements: IComparable<int>
  implements: IEquatable<int>
  inherits: ValueType
property Color.A: byte
property Color.R: byte
property Color.G: byte
property Color.B: byte
val toBitmap : (Color -> int list -> 'a)
val xs : int list

  type: int list
  implements: Collections.IStructuralEquatable
  implements: IComparable<List<int>>
  implements: IComparable
  implements: Collections.IStructuralComparable
  implements: Collections.Generic.IEnumerable<int>
  implements: Collections.IEnumerable
type 'T list = List<'T>

Full name: Microsoft.FSharp.Collections.list<_>

  type: 'T list
  implements: Collections.IStructuralEquatable
  implements: IComparable<List<'T>>
  implements: IComparable
  implements: Collections.IStructuralComparable
  implements: Collections.Generic.IEnumerable<'T>
  implements: Collections.IEnumerable
val width : int

  type: int
  implements: IComparable
  implements: IFormattable
  implements: IConvertible
  implements: IComparable<int>
  implements: IEquatable<int>
  inherits: ValueType
val white : int

  type: int
  implements: IComparable
  implements: IFormattable
  implements: IConvertible
  implements: IComparable<int>
  implements: IEquatable<int>
  inherits: ValueType
val black : int

  type: int
  implements: IComparable
  implements: IFormattable
  implements: IConvertible
  implements: IComparable<int>
  implements: IEquatable<int>
  inherits: ValueType
val toColor : (bool -> int)
val bitmap : 'a
type WriteableBitmap =
  class
    inherit System.Windows.Media.Imaging.BitmapSource
    new : System.Windows.Media.Imaging.BitmapSource -> System.Windows.Media.Imaging.WriteableBitmap
    new : int * int * float * float * System.Windows.Media.PixelFormat * System.Windows.Media.Imaging.BitmapPalette -> System.Windows.Media.Imaging.WriteableBitmap
    member AddDirtyRect : System.Windows.Int32Rect -> unit
    member BackBuffer : System.IntPtr with get, set
    member BackBufferStride : int
    member Clone : unit -> System.Windows.Media.Imaging.WriteableBitmap
    member CloneCurrentValue : unit -> System.Windows.Media.Imaging.WriteableBitmap
    member Lock : unit -> unit
    member TryLock : System.Windows.Duration -> bool
    member Unlock : unit -> unit
    member WritePixels : System.Windows.Int32Rect * System.IntPtr * int * int -> unit
    member WritePixels : System.Windows.Int32Rect * System.Array * int * int -> unit
    member WritePixels : System.Windows.Int32Rect * System.Array * int * int * int -> unit
    member WritePixels : System.Windows.Int32Rect * System.IntPtr * int * int * int * int -> unit
  end

Full name: System.Windows.Media.Imaging.WriteableBitmap

  type: WriteableBitmap
  implements: ISealable
  implements: Animation.IAnimatable
  implements: IFormattable
  implements: Composition.DUCE.IResource
  inherits: BitmapSource
  inherits: ImageSource
  inherits: Animation.Animatable
  inherits: Freezable
  inherits: DependencyObject
  inherits: Threading.DispatcherObject
property List.Length: int
val pixels : 'a
Multiple items
module List

from Microsoft.FSharp.Collections

--------------------

type List<'T> =
  | ( [] )
  | ( :: ) of 'T * 'T list
  with
    interface Collections.IEnumerable
    interface Collections.Generic.IEnumerable<'T>
    member Head : 'T
    member IsEmpty : bool
    member Item : index:int -> 'T with get
    member Length : int
    member Tail : 'T list
    static member Cons : head:'T * tail:'T list -> 'T list
    static member Empty : 'T list
  end

Full name: Microsoft.FSharp.Collections.List<_>

  type: List<'T>
  implements: Collections.IStructuralEquatable
  implements: IComparable<List<'T>>
  implements: IComparable
  implements: Collections.IStructuralComparable
  implements: Collections.Generic.IEnumerable<'T>
  implements: Collections.IEnumerable
val iteri : (int -> 'T -> unit) -> 'T list -> unit

Full name: Microsoft.FSharp.Collections.List.iteri
val y : int

  type: int
  implements: IComparable
  implements: IFormattable
  implements: IConvertible
  implements: IComparable<int>
  implements: IEquatable<int>
  inherits: ValueType
val xs : int

  type: int
  implements: IComparable
  implements: IFormattable
  implements: IConvertible
  implements: IComparable<int>
  implements: IEquatable<int>
  inherits: ValueType
val x : int

  type: int
  implements: IComparable
  implements: IFormattable
  implements: IConvertible
  implements: IComparable<int>
  implements: IEquatable<int>
  inherits: ValueType
val bit : int

  type: int
  implements: IComparable
  implements: IFormattable
  implements: IConvertible
  implements: IComparable<int>
  implements: IEquatable<int>
  inherits: ValueType
val toImage : (#BitmapSource -> Image)
val bitmap : #BitmapSource

  type: #BitmapSource
  implements: ISealable
  implements: Animation.IAnimatable
  implements: IFormattable
  implements: Composition.DUCE.IResource
  inherits: BitmapSource
  inherits: ImageSource
  inherits: Animation.Animatable
  inherits: Freezable
  inherits: DependencyObject
  inherits: Threading.DispatcherObject
type BitmapSource =
  class
    inherit System.Windows.Media.ImageSource
    member Clone : unit -> System.Windows.Media.Imaging.BitmapSource
    member CloneCurrentValue : unit -> System.Windows.Media.Imaging.BitmapSource
    member CopyPixels : System.Array * int * int -> unit
    member CopyPixels : System.Windows.Int32Rect * System.Array * int * int -> unit
    member CopyPixels : System.Windows.Int32Rect * System.IntPtr * int * int -> unit
    member DpiX : float
    member DpiY : float
    member Format : System.Windows.Media.PixelFormat
    member Height : float
    member IsDownloading : bool
    member Metadata : System.Windows.Media.ImageMetadata
    member Palette : System.Windows.Media.Imaging.BitmapPalette
    member PixelHeight : int
    member PixelWidth : int
    member Width : float
    static member Create : int * int * float * float * System.Windows.Media.PixelFormat * System.Windows.Media.Imaging.BitmapPalette * System.Array * int -> System.Windows.Media.Imaging.BitmapSource
    static member Create : int * int * float * float * System.Windows.Media.PixelFormat * System.Windows.Media.Imaging.BitmapPalette * System.IntPtr * int * int -> System.Windows.Media.Imaging.BitmapSource
  end

Full name: System.Windows.Media.Imaging.BitmapSource

  type: BitmapSource
  implements: ISealable
  implements: Animation.IAnimatable
  implements: IFormattable
  implements: Composition.DUCE.IResource
  inherits: ImageSource
  inherits: Animation.Animatable
  inherits: Freezable
  inherits: DependencyObject
  inherits: Threading.DispatcherObject
val w : int

  type: int
  implements: IComparable
  implements: IFormattable
  implements: IConvertible
  implements: IComparable<int>
  implements: IEquatable<int>
  inherits: ValueType
DependencyObject.GetValue(dp: DependencyProperty) : obj
val h : int

  type: int
  implements: IComparable
  implements: IFormattable
  implements: IConvertible
  implements: IComparable<int>
  implements: IEquatable<int>
  inherits: ValueType
type Image =
  class
    inherit System.Windows.FrameworkElement
    new : unit -> System.Windows.Controls.Image
    member Source : System.Windows.Media.ImageSource with get, set
    member Stretch : System.Windows.Media.Stretch with get, set
    member StretchDirection : System.Windows.Controls.StretchDirection with get, set
    static val SourceProperty : System.Windows.DependencyProperty
    static val StretchProperty : System.Windows.DependencyProperty
    static val StretchDirectionProperty : System.Windows.DependencyProperty
    static val ImageFailedEvent : System.Windows.RoutedEvent
  end

Full name: System.Windows.Controls.Image

  type: Image
  implements: Composition.DUCE.IResource
  implements: Animation.IAnimatable
  implements: IFrameworkInputElement
  implements: IInputElement
  implements: ComponentModel.ISupportInitialize
  implements: Markup.IHaveResources
  implements: Markup.IQueryAmbient
  implements: Markup.IUriContext
  implements: Markup.IProvidePropertyFallback
  inherits: FrameworkElement
  inherits: UIElement
  inherits: Visual
  inherits: DependencyObject
  inherits: Threading.DispatcherObject
type Stretch =
  | None = 0
  | Fill = 1
  | Uniform = 2
  | UniformToFill = 3

Full name: System.Windows.Media.Stretch

  type: Stretch
  inherits: Enum
  inherits: ValueType
field Stretch.Fill = 1
Multiple items
val float : 'T -> float (requires member op_Explicit)

Full name: Microsoft.FSharp.Core.Operators.float

--------------------

type float<'Measure> = float

Full name: Microsoft.FSharp.Core.float<_>

  type: float<'Measure>
  implements: IComparable
  implements: IConvertible
  implements: IFormattable
  implements: IComparable<float<'Measure>>
  implements: IEquatable<float<'Measure>>
  inherits: ValueType


--------------------

type float = Double

Full name: Microsoft.FSharp.Core.float

  type: float
  implements: IComparable
  implements: IFormattable
  implements: IConvertible
  implements: IComparable<float>
  implements: IEquatable<float>
  inherits: ValueType
val tops : (int * int * int) list

  type: (int * int * int) list
  implements: Collections.IStructuralEquatable
  implements: IComparable<List<int * int * int>>
  implements: IComparable
  implements: Collections.IStructuralComparable
  implements: Collections.Generic.IEnumerable<int * int * int>
  implements: Collections.IEnumerable
val mids : (int * int * int) list

  type: (int * int * int) list
  implements: Collections.IStructuralEquatable
  implements: IComparable<List<int * int * int>>
  implements: IComparable
  implements: Collections.IStructuralComparable
  implements: Collections.Generic.IEnumerable<int * int * int>
  implements: Collections.IEnumerable
val bots : (int * int * int) list

  type: (int * int * int) list
  implements: Collections.IStructuralEquatable
  implements: IComparable<List<int * int * int>>
  implements: IComparable
  implements: Collections.IStructuralComparable
  implements: Collections.Generic.IEnumerable<int * int * int>
  implements: Collections.IEnumerable
val pill' : int list

  type: int list
  implements: Collections.IStructuralEquatable
  implements: IComparable<List<int>>
  implements: IComparable
  implements: Collections.IStructuralComparable
  implements: Collections.Generic.IEnumerable<int>
  implements: Collections.IEnumerable
val power' : int list

  type: int list
  implements: Collections.IStructuralEquatable
  implements: IComparable<List<int>>
  implements: IComparable
  implements: Collections.IStructuralComparable
  implements: Collections.Generic.IEnumerable<int>
  implements: Collections.IEnumerable
val fromTriple : ((int * int * int) list -> 'a * 'a * 'a)
val xs : (int * int * int) list

  type: (int * int * int) list
  implements: Collections.IStructuralEquatable
  implements: IComparable<List<int * int * int>>
  implements: IComparable
  implements: Collections.IStructuralComparable
  implements: Collections.Generic.IEnumerable<int * int * int>
  implements: Collections.IEnumerable
val convert : (int list -> 'a)
type Colors =
  class
    static member AliceBlue : System.Windows.Media.Color
    static member AntiqueWhite : System.Windows.Media.Color
    static member Aqua : System.Windows.Media.Color
    static member Aquamarine : System.Windows.Media.Color
    static member Azure : System.Windows.Media.Color
    static member Beige : System.Windows.Media.Color
    static member Bisque : System.Windows.Media.Color
    static member Black : System.Windows.Media.Color
    static member BlanchedAlmond : System.Windows.Media.Color
    static member Blue : System.Windows.Media.Color
    static member BlueViolet : System.Windows.Media.Color
    static member Brown : System.Windows.Media.Color
    static member BurlyWood : System.Windows.Media.Color
    static member CadetBlue : System.Windows.Media.Color
    static member Chartreuse : System.Windows.Media.Color
    static member Chocolate : System.Windows.Media.Color
    static member Coral : System.Windows.Media.Color
    static member CornflowerBlue : System.Windows.Media.Color
    static member Cornsilk : System.Windows.Media.Color
    static member Crimson : System.Windows.Media.Color
    static member Cyan : System.Windows.Media.Color
    static member DarkBlue : System.Windows.Media.Color
    static member DarkCyan : System.Windows.Media.Color
    static member DarkGoldenrod : System.Windows.Media.Color
    static member DarkGray : System.Windows.Media.Color
    static member DarkGreen : System.Windows.Media.Color
    static member DarkKhaki : System.Windows.Media.Color
    static member DarkMagenta : System.Windows.Media.Color
    static member DarkOliveGreen : System.Windows.Media.Color
    static member DarkOrange : System.Windows.Media.Color
    static member DarkOrchid : System.Windows.Media.Color
    static member DarkRed : System.Windows.Media.Color
    static member DarkSalmon : System.Windows.Media.Color
    static member DarkSeaGreen : System.Windows.Media.Color
    static member DarkSlateBlue : System.Windows.Media.Color
    static member DarkSlateGray : System.Windows.Media.Color
    static member DarkTurquoise : System.Windows.Media.Color
    static member DarkViolet : System.Windows.Media.Color
    static member DeepPink : System.Windows.Media.Color
    static member DeepSkyBlue : System.Windows.Media.Color
    static member DimGray : System.Windows.Media.Color
    static member DodgerBlue : System.Windows.Media.Color
    static member Firebrick : System.Windows.Media.Color
    static member FloralWhite : System.Windows.Media.Color
    static member ForestGreen : System.Windows.Media.Color
    static member Fuchsia : System.Windows.Media.Color
    static member Gainsboro : System.Windows.Media.Color
    static member GhostWhite : System.Windows.Media.Color
    static member Gold : System.Windows.Media.Color
    static member Goldenrod : System.Windows.Media.Color
    static member Gray : System.Windows.Media.Color
    static member Green : System.Windows.Media.Color
    static member GreenYellow : System.Windows.Media.Color
    static member Honeydew : System.Windows.Media.Color
    static member HotPink : System.Windows.Media.Color
    static member IndianRed : System.Windows.Media.Color
    static member Indigo : System.Windows.Media.Color
    static member Ivory : System.Windows.Media.Color
    static member Khaki : System.Windows.Media.Color
    static member Lavender : System.Windows.Media.Color
    static member LavenderBlush : System.Windows.Media.Color
    static member LawnGreen : System.Windows.Media.Color
    static member LemonChiffon : System.Windows.Media.Color
    static member LightBlue : System.Windows.Media.Color
    static member LightCoral : System.Windows.Media.Color
    static member LightCyan : System.Windows.Media.Color
    static member LightGoldenrodYellow : System.Windows.Media.Color
    static member LightGray : System.Windows.Media.Color
    static member LightGreen : System.Windows.Media.Color
    static member LightPink : System.Windows.Media.Color
    static member LightSalmon : System.Windows.Media.Color
    static member LightSeaGreen : System.Windows.Media.Color
    static member LightSkyBlue : System.Windows.Media.Color
    static member LightSlateGray : System.Windows.Media.Color
    static member LightSteelBlue : System.Windows.Media.Color
    static member LightYellow : System.Windows.Media.Color
    static member Lime : System.Windows.Media.Color
    static member LimeGreen : System.Windows.Media.Color
    static member Linen : System.Windows.Media.Color
    static member Magenta : System.Windows.Media.Color
    static member Maroon : System.Windows.Media.Color
    static member MediumAquamarine : System.Windows.Media.Color
    static member MediumBlue : System.Windows.Media.Color
    static member MediumOrchid : System.Windows.Media.Color
    static member MediumPurple : System.Windows.Media.Color
    static member MediumSeaGreen : System.Windows.Media.Color
    static member MediumSlateBlue : System.Windows.Media.Color
    static member MediumSpringGreen : System.Windows.Media.Color
    static member MediumTurquoise : System.Windows.Media.Color
    static member MediumVioletRed : System.Windows.Media.Color
    static member MidnightBlue : System.Windows.Media.Color
    static member MintCream : System.Windows.Media.Color
    static member MistyRose : System.Windows.Media.Color
    static member Moccasin : System.Windows.Media.Color
    static member NavajoWhite : System.Windows.Media.Color
    static member Navy : System.Windows.Media.Color
    static member OldLace : System.Windows.Media.Color
    static member Olive : System.Windows.Media.Color
    static member OliveDrab : System.Windows.Media.Color
    static member Orange : System.Windows.Media.Color
    static member OrangeRed : System.Windows.Media.Color
    static member Orchid : System.Windows.Media.Color
    static member PaleGoldenrod : System.Windows.Media.Color
    static member PaleGreen : System.Windows.Media.Color
    static member PaleTurquoise : System.Windows.Media.Color
    static member PaleVioletRed : System.Windows.Media.Color
    static member PapayaWhip : System.Windows.Media.Color
    static member PeachPuff : System.Windows.Media.Color
    static member Peru : System.Windows.Media.Color
    static member Pink : System.Windows.Media.Color
    static member Plum : System.Windows.Media.Color
    static member PowderBlue : System.Windows.Media.Color
    static member Purple : System.Windows.Media.Color
    static member Red : System.Windows.Media.Color
    static member RosyBrown : System.Windows.Media.Color
    static member RoyalBlue : System.Windows.Media.Color
    static member SaddleBrown : System.Windows.Media.Color
    static member Salmon : System.Windows.Media.Color
    static member SandyBrown : System.Windows.Media.Color
    static member SeaGreen : System.Windows.Media.Color
    static member SeaShell : System.Windows.Media.Color
    static member Sienna : System.Windows.Media.Color
    static member Silver : System.Windows.Media.Color
    static member SkyBlue : System.Windows.Media.Color
    static member SlateBlue : System.Windows.Media.Color
    static member SlateGray : System.Windows.Media.Color
    static member Snow : System.Windows.Media.Color
    static member SpringGreen : System.Windows.Media.Color
    static member SteelBlue : System.Windows.Media.Color
    static member Tan : System.Windows.Media.Color
    static member Teal : System.Windows.Media.Color
    static member Thistle : System.Windows.Media.Color
    static member Tomato : System.Windows.Media.Color
    static member Transparent : System.Windows.Media.Color
    static member Turquoise : System.Windows.Media.Color
    static member Violet : System.Windows.Media.Color
    static member Wheat : System.Windows.Media.Color
    static member White : System.Windows.Media.Color
    static member WhiteSmoke : System.Windows.Media.Color
    static member Yellow : System.Windows.Media.Color
    static member YellowGreen : System.Windows.Media.Color
  end

Full name: System.Windows.Media.Colors
property Colors.Blue: Color
val foldBack : ('T -> 'State -> 'State) -> 'T list -> 'State -> 'State

Full name: Microsoft.FSharp.Collections.List.foldBack
val l : int

  type: int
  implements: IComparable
  implements: IFormattable
  implements: IConvertible
  implements: IComparable<int>
  implements: IEquatable<int>
  inherits: ValueType
val m : int

  type: int
  implements: IComparable
  implements: IFormattable
  implements: IConvertible
  implements: IComparable<int>
  implements: IEquatable<int>
  inherits: ValueType
val r : int

  type: int
  implements: IComparable
  implements: IFormattable
  implements: IConvertible
  implements: IComparable<int>
  implements: IEquatable<int>
  inherits: ValueType
val ls : int list

  type: int list
  implements: Collections.IStructuralEquatable
  implements: IComparable<List<int>>
  implements: IComparable
  implements: Collections.IStructuralComparable
  implements: Collections.Generic.IEnumerable<int>
  implements: Collections.IEnumerable
val ms : int list

  type: int list
  implements: Collections.IStructuralEquatable
  implements: IComparable<List<int>>
  implements: IComparable
  implements: Collections.IStructuralComparable
  implements: Collections.Generic.IEnumerable<int>
  implements: Collections.IEnumerable
val rs : int list

  type: int list
  implements: Collections.IStructuralEquatable
  implements: IComparable<List<int>>
  implements: IComparable
  implements: Collections.IStructuralComparable
  implements: Collections.Generic.IEnumerable<int>
  implements: Collections.IEnumerable
val l : int list

  type: int list
  implements: Collections.IStructuralEquatable
  implements: IComparable<List<int>>
  implements: IComparable
  implements: Collections.IStructuralComparable
  implements: Collections.Generic.IEnumerable<int>
  implements: Collections.IEnumerable
val m : int list

  type: int list
  implements: Collections.IStructuralEquatable
  implements: IComparable<List<int>>
  implements: IComparable
  implements: Collections.IStructuralComparable
  implements: Collections.Generic.IEnumerable<int>
  implements: Collections.IEnumerable
val r : int list

  type: int list
  implements: Collections.IStructuralEquatable
  implements: IComparable<List<int>>
  implements: IComparable
  implements: Collections.IStructuralComparable
  implements: Collections.Generic.IEnumerable<int>
  implements: Collections.IEnumerable
val tl : 'a (requires 'a :> BitmapSource)

  type: 'a
  implements: ISealable
  implements: Animation.IAnimatable
  implements: IFormattable
  implements: Composition.DUCE.IResource
  inherits: BitmapSource
  inherits: ImageSource
  inherits: Animation.Animatable
  inherits: Freezable
  inherits: DependencyObject
  inherits: Threading.DispatcherObject
val top : 'a (requires 'a :> BitmapSource)

  type: 'a
  implements: ISealable
  implements: Animation.IAnimatable
  implements: IFormattable
  implements: Composition.DUCE.IResource
  inherits: BitmapSource
  inherits: ImageSource
  inherits: Animation.Animatable
  inherits: Freezable
  inherits: DependencyObject
  inherits: Threading.DispatcherObject
val tr : 'a (requires 'a :> BitmapSource)

  type: 'a
  implements: ISealable
  implements: Animation.IAnimatable
  implements: IFormattable
  implements: Composition.DUCE.IResource
  inherits: BitmapSource
  inherits: ImageSource
  inherits: Animation.Animatable
  inherits: Freezable
  inherits: DependencyObject
  inherits: Threading.DispatcherObject
val left : 'a (requires 'a :> BitmapSource)

  type: 'a
  implements: ISealable
  implements: Animation.IAnimatable
  implements: IFormattable
  implements: Composition.DUCE.IResource
  inherits: BitmapSource
  inherits: ImageSource
  inherits: Animation.Animatable
  inherits: Freezable
  inherits: DependencyObject
  inherits: Threading.DispatcherObject
val blank : 'a (requires 'a :> BitmapSource)

  type: 'a
  implements: ISealable
  implements: Animation.IAnimatable
  implements: IFormattable
  implements: Composition.DUCE.IResource
  inherits: BitmapSource
  inherits: ImageSource
  inherits: Animation.Animatable
  inherits: Freezable
  inherits: DependencyObject
  inherits: Threading.DispatcherObject
val right : 'a (requires 'a :> BitmapSource)

  type: 'a
  implements: ISealable
  implements: Animation.IAnimatable
  implements: IFormattable
  implements: Composition.DUCE.IResource
  inherits: BitmapSource
  inherits: ImageSource
  inherits: Animation.Animatable
  inherits: Freezable
  inherits: DependencyObject
  inherits: Threading.DispatcherObject
val bl : 'a (requires 'a :> BitmapSource)

  type: 'a
  implements: ISealable
  implements: Animation.IAnimatable
  implements: IFormattable
  implements: Composition.DUCE.IResource
  inherits: BitmapSource
  inherits: ImageSource
  inherits: Animation.Animatable
  inherits: Freezable
  inherits: DependencyObject
  inherits: Threading.DispatcherObject
val bottom : 'a (requires 'a :> BitmapSource)

  type: 'a
  implements: ISealable
  implements: Animation.IAnimatable
  implements: IFormattable
  implements: Composition.DUCE.IResource
  inherits: BitmapSource
  inherits: ImageSource
  inherits: Animation.Animatable
  inherits: Freezable
  inherits: DependencyObject
  inherits: Threading.DispatcherObject
val br : 'a (requires 'a :> BitmapSource)

  type: 'a
  implements: ISealable
  implements: Animation.IAnimatable
  implements: IFormattable
  implements: Composition.DUCE.IResource
  inherits: BitmapSource
  inherits: ImageSource
  inherits: Animation.Animatable
  inherits: Freezable
  inherits: DependencyObject
  inherits: Threading.DispatcherObject
val pill : 'a (requires 'a :> BitmapSource)

  type: 'a
  implements: ISealable
  implements: Animation.IAnimatable
  implements: IFormattable
  implements: Composition.DUCE.IResource
  inherits: BitmapSource
  inherits: ImageSource
  inherits: Animation.Animatable
  inherits: Freezable
  inherits: DependencyObject
  inherits: Threading.DispatcherObject
property Colors.Yellow: Color
val power : 'a (requires 'a :> BitmapSource)

  type: 'a
  implements: ISealable
  implements: Animation.IAnimatable
  implements: IFormattable
  implements: Composition.DUCE.IResource
  inherits: BitmapSource
  inherits: ImageSource
  inherits: Animation.Animatable
  inherits: Freezable
  inherits: DependencyObject
  inherits: Threading.DispatcherObject
val toTile : (char -> 'a) (requires 'a :> BitmapSource)
val c : char

  type: char
  implements: IComparable
  implements: IConvertible
  implements: IComparable<char>
  implements: IEquatable<char>
  inherits: ValueType
val canvas : Canvas

  type: Canvas
  implements: Composition.DUCE.IResource
  implements: Animation.IAnimatable
  implements: IFrameworkInputElement
  implements: IInputElement
  implements: ComponentModel.ISupportInitialize
  implements: Markup.IHaveResources
  implements: Markup.IQueryAmbient
  implements: Markup.IAddChild
  inherits: Panel
  inherits: FrameworkElement
  inherits: UIElement
  inherits: Visual
  inherits: DependencyObject
  inherits: Threading.DispatcherObject
type Canvas =
  class
    inherit System.Windows.Controls.Panel
    new : unit -> System.Windows.Controls.Canvas
    static val LeftProperty : System.Windows.DependencyProperty
    static val TopProperty : System.Windows.DependencyProperty
    static val RightProperty : System.Windows.DependencyProperty
    static val BottomProperty : System.Windows.DependencyProperty
    static member GetBottom : System.Windows.UIElement -> float
    static member GetLeft : System.Windows.UIElement -> float
    static member GetRight : System.Windows.UIElement -> float
    static member GetTop : System.Windows.UIElement -> float
    static member SetBottom : System.Windows.UIElement * float -> unit
    static member SetLeft : System.Windows.UIElement * float -> unit
    static member SetRight : System.Windows.UIElement * float -> unit
    static member SetTop : System.Windows.UIElement * float -> unit
  end

Full name: System.Windows.Controls.Canvas

  type: Canvas
  implements: Composition.DUCE.IResource
  implements: Animation.IAnimatable
  implements: IFrameworkInputElement
  implements: IInputElement
  implements: ComponentModel.ISupportInitialize
  implements: Markup.IHaveResources
  implements: Markup.IQueryAmbient
  implements: Markup.IAddChild
  inherits: Panel
  inherits: FrameworkElement
  inherits: UIElement
  inherits: Visual
  inherits: DependencyObject
  inherits: Threading.DispatcherObject
type SolidColorBrush =
  class
    inherit System.Windows.Media.Brush
    new : unit -> System.Windows.Media.SolidColorBrush
    new : System.Windows.Media.Color -> System.Windows.Media.SolidColorBrush
    member Clone : unit -> System.Windows.Media.SolidColorBrush
    member CloneCurrentValue : unit -> System.Windows.Media.SolidColorBrush
    member Color : System.Windows.Media.Color with get, set
    static val ColorProperty : System.Windows.DependencyProperty
    static member DeserializeFrom : System.IO.BinaryReader -> obj
  end

Full name: System.Windows.Media.SolidColorBrush

  type: SolidColorBrush
  implements: ISealable
  implements: Animation.IAnimatable
  implements: IFormattable
  implements: Composition.DUCE.IResource
  inherits: Brush
  inherits: Animation.Animatable
  inherits: Freezable
  inherits: DependencyObject
  inherits: Threading.DispatcherObject
property Colors.Black: Color
property ContentControl.Content: obj
val lines : string []

  type: string []
  implements: ICloneable
  implements: Collections.IList
  implements: Collections.ICollection
  implements: Collections.IStructuralComparable
  implements: Collections.IStructuralEquatable
  implements: Collections.Generic.IList<string>
  implements: Collections.Generic.ICollection<string>
  implements: seq<string>
  implements: Collections.IEnumerable
  inherits: Array
Multiple overloads
String.Split(separator: char []) : string []
String.Split(separator: string [], options: StringSplitOptions) : string []
String.Split(separator: char [], options: StringSplitOptions) : string []
String.Split(separator: char [], count: int) : string []
String.Split(separator: string [], count: int, options: StringSplitOptions) : string []
String.Split(separator: char [], count: int, options: StringSplitOptions) : string []
type Array =
  class
    member Clone : unit -> obj
    member CopyTo : System.Array * int -> unit
    member CopyTo : System.Array * int64 -> unit
    member GetEnumerator : unit -> System.Collections.IEnumerator
    member GetLength : int -> int
    member GetLongLength : int -> int64
    member GetLowerBound : int -> int
    member GetUpperBound : int -> int
    member GetValue : int [] -> obj
    member GetValue : int -> obj
    member GetValue : int64 -> obj
    member GetValue : int64 [] -> obj
    member GetValue : int * int -> obj
    member GetValue : int64 * int64 -> obj
    member GetValue : int * int * int -> obj
    member GetValue : int64 * int64 * int64 -> obj
    member Initialize : unit -> unit
    member IsFixedSize : bool
    member IsReadOnly : bool
    member IsSynchronized : bool
    member Length : int
    member LongLength : int64
    member Rank : int
    member SetValue : obj * int -> unit
    member SetValue : obj * int [] -> unit
    member SetValue : obj * int64 -> unit
    member SetValue : obj * int64 [] -> unit
    member SetValue : obj * int * int -> unit
    member SetValue : obj * int64 * int64 -> unit
    member SetValue : obj * int * int * int -> unit
    member SetValue : obj * int64 * int64 * int64 -> unit
    member SyncRoot : obj
    static member AsReadOnly<'T> : 'T [] -> System.Collections.ObjectModel.ReadOnlyCollection<'T>
    static member BinarySearch : System.Array * obj -> int
    static member BinarySearch<'T> : 'T [] * 'T -> int
    static member BinarySearch : System.Array * obj * System.Collections.IComparer -> int
    static member BinarySearch<'T> : 'T [] * 'T * System.Collections.Generic.IComparer<'T> -> int
    static member BinarySearch : System.Array * int * int * obj -> int
    static member BinarySearch<'T> : 'T [] * int * int * 'T -> int
    static member BinarySearch : System.Array * int * int * obj * System.Collections.IComparer -> int
    static member BinarySearch<'T> : 'T [] * int * int * 'T * System.Collections.Generic.IComparer<'T> -> int
    static member Clear : System.Array * int * int -> unit
    static member ConstrainedCopy : System.Array * int * System.Array * int * int -> unit
    static member ConvertAll<'TInput,'TOutput> : 'TInput [] * System.Converter<'TInput,'TOutput> -> 'TOutput []
    static member Copy : System.Array * System.Array * int -> unit
    static member Copy : System.Array * System.Array * int64 -> unit
    static member Copy : System.Array * int * System.Array * int * int -> unit
    static member Copy : System.Array * int64 * System.Array * int64 * int64 -> unit
    static member CreateInstance : System.Type * int -> System.Array
    static member CreateInstance : System.Type * int [] -> System.Array
    static member CreateInstance : System.Type * int64 [] -> System.Array
    static member CreateInstance : System.Type * int * int -> System.Array
    static member CreateInstance : System.Type * int [] * int [] -> System.Array
    static member CreateInstance : System.Type * int * int * int -> System.Array
    static member Exists<'T> : 'T [] * System.Predicate<'T> -> bool
    static member Find<'T> : 'T [] * System.Predicate<'T> -> 'T
    static member FindAll<'T> : 'T [] * System.Predicate<'T> -> 'T []
    static member FindIndex<'T> : 'T [] * System.Predicate<'T> -> int
    static member FindIndex<'T> : 'T [] * int * System.Predicate<'T> -> int
    static member FindIndex<'T> : 'T [] * int * int * System.Predicate<'T> -> int
    static member FindLast<'T> : 'T [] * System.Predicate<'T> -> 'T
    static member FindLastIndex<'T> : 'T [] * System.Predicate<'T> -> int
    static member FindLastIndex<'T> : 'T [] * int * System.Predicate<'T> -> int
    static member FindLastIndex<'T> : 'T [] * int * int * System.Predicate<'T> -> int
    static member ForEach<'T> : 'T [] * System.Action<'T> -> unit
    static member IndexOf : System.Array * obj -> int
    static member IndexOf<'T> : 'T [] * 'T -> int
    static member IndexOf : System.Array * obj * int -> int
    static member IndexOf<'T> : 'T [] * 'T * int -> int
    static member IndexOf : System.Array * obj * int * int -> int
    static member IndexOf<'T> : 'T [] * 'T * int * int -> int
    static member LastIndexOf : System.Array * obj -> int
    static member LastIndexOf<'T> : 'T [] * 'T -> int
    static member LastIndexOf : System.Array * obj * int -> int
    static member LastIndexOf<'T> : 'T [] * 'T * int -> int
    static member LastIndexOf : System.Array * obj * int * int -> int
    static member LastIndexOf<'T> : 'T [] * 'T * int * int -> int
    static member Resize<'T> : 'T [] * int -> unit
    static member Reverse : System.Array -> unit
    static member Reverse : System.Array * int * int -> unit
    static member Sort : System.Array -> unit
    static member Sort<'T> : 'T [] -> unit
    static member Sort : System.Array * System.Array -> unit
    static member Sort : System.Array * System.Collections.IComparer -> unit
    static member Sort<'TKey,'TValue> : 'TKey [] * 'TValue [] -> unit
    static member Sort<'T> : 'T [] * System.Collections.Generic.IComparer<'T> -> unit
    static member Sort<'T> : 'T [] * System.Comparison<'T> -> unit
    static member Sort : System.Array * int * int -> unit
    static member Sort : System.Array * System.Array * System.Collections.IComparer -> unit
    static member Sort<'T> : 'T [] * int * int -> unit
    static member Sort<'TKey,'TValue> : 'TKey [] * 'TValue [] * System.Collections.Generic.IComparer<'TKey> -> unit
    static member Sort : System.Array * System.Array * int * int -> unit
    static member Sort : System.Array * int * int * System.Collections.IComparer -> unit
    static member Sort<'TKey,'TValue> : 'TKey [] * 'TValue [] * int * int -> unit
    static member Sort<'T> : 'T [] * int * int * System.Collections.Generic.IComparer<'T> -> unit
    static member Sort : System.Array * System.Array * int * int * System.Collections.IComparer -> unit
    static member Sort<'TKey,'TValue> : 'TKey [] * 'TValue [] * int * int * System.Collections.Generic.IComparer<'TKey> -> unit
    static member TrueForAll<'T> : 'T [] * System.Predicate<'T> -> bool
  end

Full name: System.Array

  type: Array
  implements: ICloneable
  implements: Collections.IList
  implements: Collections.ICollection
  implements: Collections.IEnumerable
  implements: Collections.IStructuralComparable
  implements: Collections.IStructuralEquatable
val iteri : (int -> 'T -> unit) -> 'T [] -> unit

Full name: Microsoft.FSharp.Collections.Array.iteri
val line : string

  type: string
  implements: IComparable
  implements: ICloneable
  implements: IConvertible
  implements: IComparable<string>
  implements: seq<char>
  implements: Collections.IEnumerable
  implements: IEquatable<string>
module Seq

from Microsoft.FSharp.Collections
val iteri : (int -> 'T -> unit) -> seq<'T> -> unit

Full name: Microsoft.FSharp.Collections.Seq.iteri
val item : char

  type: char
  implements: IComparable
  implements: IConvertible
  implements: IComparable<char>
  implements: IEquatable<char>
  inherits: ValueType
val tile : Image

  type: Image
  implements: Composition.DUCE.IResource
  implements: Animation.IAnimatable
  implements: IFrameworkInputElement
  implements: IInputElement
  implements: ComponentModel.ISupportInitialize
  implements: Markup.IHaveResources
  implements: Markup.IQueryAmbient
  implements: Markup.IUriContext
  implements: Markup.IProvidePropertyFallback
  inherits: FrameworkElement
  inherits: UIElement
  inherits: Visual
  inherits: DependencyObject
  inherits: Threading.DispatcherObject
Canvas.SetLeft(element: UIElement, length: float) : unit
Canvas.SetTop(element: UIElement, length: float) : unit
property Panel.Children: UIElementCollection
UIElementCollection.Add(element: UIElement) : int
val ignore : 'T -> unit

Full name: Microsoft.FSharp.Core.Operators.ignore
#if INTERACTIVE
open Microsoft.TryFSharp
App.Dispatch (fun() ->
    App.Console.ClearCanvas()
    let canvas = App.Console.Canvas
    canvas.Background <- SolidColorBrush Colors.Black
    let control = GameControl()
    control |> canvas.Children.Add
    App.Console.CanvasPosition <- CanvasPosition.Right
    control.Focus() |> ignore
)
#endif

More information

Link: http://fssnip.net/9V
Posted: 2 years ago
Author: Phillip Trelford (website)
Tags: Game