Anthony Brown @bruinbrown93
F# is a strongly statically typed, multi paradigm, eagerly evaluated, open source high level programming language from Microsoft that runs on the .NET framework
Open source cross platform implementation of XNA
let tex = Content.Load<Texture2D> "player.png"
do spriteBatch.Begin ()
do spriteBatch.Draw(tex, Vector2.Zero, Color.White)
do spriteBatch.End ()
C# - Team of 5 - 1 day
F# - Team of 1 - 4 hours
type Enemy =
| RocketMan of int * int * string * string
| Snail of float * int * string
type Health = int
type Lives = int
type Name = string
type Catchphrase = string
type Speed = float
type Enemy =
| Rocketman of Health * Lives * Name * Catchphrase
| Snail of Speed * Health * Name
let Move x y =
x + y
[<Measure>]
type Metre
let Move (x:float<Metre>) (y:float<Metre>)
x + y
let x = 32
log x
let y = 2
let z = x * y
log z
log {
let! x = 32
let y = 2
let! z = x * y
return z
}
var enemy = World.Enemy;
switch(enemy.State)
{
case AIState.Moving:
...
case AIState.FindingPlayer:
...
}
let ai = new AIBuilder()
ai {
move 10
let! player = World.Player
find player
chase player
}