chiark
/
gitweb
/
~ianmdlvl
/
matchsticks-search.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
move minham check earlier; this avoids some printing etc
[matchsticks-search.git]
/
main.c
diff --git
a/main.c
b/main.c
index 97b4bbbcc2071972bbc5ce38d7e1b09ef2bc6479..c5a49918869d9c8c1b07d865353cb856ece2c61f 100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-458,13
+458,6
@@
static void optimise(bool doprint) {
if (!ok)
goto out;
if (!ok)
goto out;
- for (j=0; j<m; j++)
- if (weight[j] < 2) {
- PRINTF(" nominham");
- goto out;
- }
-
-
/*
* We formulate our problem as an LP problem as follows.
* In this file "n" and "m" are the matchstick numbers.
/*
* We formulate our problem as an LP problem as follows.
* In this file "n" and "m" are the matchstick numbers.
@@
-635,6
+628,10
@@
static void iterate_recurse(int i, AdjWord min) {
AdjWord jbit;
if (i >= n) {
AdjWord jbit;
if (i >= n) {
+ for (j=0; j<m; j++)
+ if (weight[j] < 2)
+ return;
+
printcounter++;
optimise(!(printcounter & 0xfff));
return;
printcounter++;
optimise(!(printcounter & 0xfff));
return;