I have always dreamed about doing this:
I wrote GetFactBasedMove function four different times because I kept confusing myself. My suggestion, is work it on paper one step at a time...write really clear notes to self...and then begin coding.
but every time I started I started coding at some point... I think it is really hard to do everything on paper when you are not even sure about how to do some of the single parts...
I really need to get some practice with that...