|A little programming chalenge|
Message #1 Posted by Patrice on 15 Sept 2010, 7:22 p.m.
Here is a little programming chalenge (no prices). I will present my solution at HHC 2010.
It is all about optimization: be as fast as possible.
The goal is to fill as much as possible places in a figure while respecting the rule.
The figure is a square or a rectangle.
The rule is that there must be no more than 3 consecutive places filled in a row, a colomn or a diagonal.
Here is a 4*4 square :
. * * *
* * . *
* . * *
* * * .
Since the amount of calculus grows quickly, the programming can be done on a PC.
If you are under a minute of runtime, just make the figure bigger:
4*4, 4*5, 5*5, 5*6, 6*6, 6*7, 7*7 and so on.
To compare the results, give the size of your figure, the number of time you have try to fill a place, the timing in seconds, and the language for advice :
4 4 12 0 D
Be smart guys :-)
Edited: 16 Sept 2010, 1:30 a.m. after one or more responses were posted