I am on 2-week vacation right now, with internet sessions from time to time. I have found 755 and will try to answer questions right now.
Hi Jarek. I might have found a program error
Код:
if(bad&&number[*t[r][c]]!=3);
{
ImproveRing(HalfRandomRing(r+N,c+N),(rand()%3)?1:-1);
#if (N%2)==0
if(bad&&number[*t[r][c]]!=3)ImproveRing(HalfRandomRing2(r+N,c+N),(rand()%3)?1:-1);
#endif
}
the ; at the end of the statement would cause the code inside the braces to be executed every time.
Can you tell me how to change the program to find 761 or higher ( something quickly ). I want to make sure the program is running correctly.
Indeed, it is a bug. The effect is even worse than you write, since it causes the the triple-for loop just before that to be practically ignored. I have this bug in all my programs, so it is not critical - without testing I cannot be sure what would happen after fixing it.
The simplest way to alter the program to search for a larger magic constatnt is to change -6 to a positive multiple of 6 on line 35 of Main7-755.c
It is also good to change SUM on line 7, but this is used for filenames only and does not affect the search.
-- Пн авг 26, 2013 18:30:09 --I changed the sum to 767 and changed the -=6 to +=12.
I quickly had 1 fault results. I ran with the ; removed in the above code.
changed to 773 and += 18 and got a result.
https://www.dropbox.com/s/rddu003k1au0qkz/869.jpgNot the correct sum, but it is a solution
should give
and
should give 779. I have no clue where 869 came from.
-- Пн авг 26, 2013 18:47:01 --The results are the same with and without the ;. without finds solutions much faster.
Removing the ; reverts the code to what I have intended to do. The only problem is that I have done some tuneup of the program picking C300, C10, B10 on lines 16-18 of Main7-755.c
I made the tuneup with the bug - perhaps without the bug program is the fastest with some other constants.
For a tuneup or tests you can also do the following:
Alter line 1 of log.h changing SEED%100000 to SEED%smallernumber to increase frequency of logging - program records numbers of 1, 2, 3-fault solutions found.
Alter line 56 of Tab-ini.h
if(bad<=1)
changing 1 to a larger number - that way solutions with that number of faults will be stored in a file (format convenient for Mathematica) and can be verified.