Geeks With Blogs

News I have joined Anti-IF Campaign
Subscribe in a reader
Lukas Domagala
While I was building the position heuristic function for Connect Four I ran into an interesting gotcha with F# pattern matching. Lets see if you see it before I tell you what it is: let rec heuristic (positions: (int * int) list) (pos: int*int) = match positions with | [] -> 0 | position::_ -> 1 + (heuristic (List.tl positions) pos) | _ -> ......

I ran into some rather interesting numbers while trying to optimize my Connect Four implementation. Try to guess what this code will print out: let test= let stop1 = Stopwatch.StartNew() let list = [1..1000000] let bla = list |> List.fold (fun state x -> state + x) 0 stop1.Stop() let stop2 = Stopwatch.StartNew() let seq = seq{1..1000000} |> ......

Last time we saw how to implement the basic miniMax algorithm, this time we will continue by designing game board representation. Basically I want to start out with the “simplest thing that might possibly work” and optimize from there. The simplest thing to use for this in F# is a 2 dimensional list. The problem is that we get some really bad performance ......

Ok, so do you have any idea what happens when you evaluate this? printfn "%d" -Int32.MinValue;; Well I would have guessed I´d get Int32.MaxValue, but well I was wrong. Actually it overflows again and prints Int32.MinValue. Interesting behavior that drove me mad while i was trying to implement Alpha-Beta pruning. There is a simple reason this happens: ......

Lately there has been a lot of buzz about functional programming, mostly because it is supposed to be the cure to all of our concurrency troubles. The answer to this from MS has been to productize F#, a functional, object oriented language, running on .Net . There have been a lot of great blog posts and articles about F# in the internet, so if you are ......

Coding would be the right answer I guess, but more about that later. I will be starting out this blog with a totally useless post just to try out the GWB blogging software, so if you are reading this spare yourself the pain... Other then that I will soon start with a series on F# programming and hope to continue bringing in some .Net content. Cheers ......

Copyright © Domagala | Powered by: GeeksWithBlogs.net | Join free