0
comment
on 3/16/2012 2:29 AM
This week I had pleasure of meeting Vagif Abilov on Tomas Petricek and I’s Advanced F# course at Skills Matter. Vagif mentioned a Ruby implementation of Conway’s Game of Life being squeezed into 140 characters for tweeting and how that might look in F#. Here’s the 140 characters of Ruby: life=->g,s{(0..s*s-1).map{|i|->n{n==3||(g[i]&&n==2)||nil} [[g[i-s-1],g[i-s],g[i-s+1],g[i-1],g[i+1],g[i+s-1],g[i+s],g[i+s+1]] .compact.count]}}   And 137 characters of F#: let f s g = g|>List.mapi(fun i x->match x,Seq.sumBy[...]
>> Read the full article on trelford.com
.
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us
Built with WebSharper