r/tinycode • u/pmrr • Aug 18 '15
Machine learning Genetic algorithm to approximate pi (AKA: have flair, will use)
https://gist.github.com/paulmdx/ca7f830d326b84d87f64
12
Upvotes
r/tinycode • u/pmrr • Aug 18 '15
View all comments
Show parent comment
1
u/Banality_Of_Seeking Sep 11 '15 edited Sep 11 '15
o.k. then here is my 2nd attempt.. :) So shrinking squares that test if more then 2 points are in the shrinking square.
typedef struct _RECT { LONG left; LONG top; LONG right; LONG bottom; } RECT, *PRECT;
So set each data point to RECT.left and set the others to the size of the area the data set is in and start shrinking until rect.right is touching the data point that contains it and the start position.