fixed eastsig and westsig being initialized in reversed + config fixes

This commit is contained in:
Alexandre 2024-08-25 16:33:30 +02:00
parent 48a4f4f88b
commit 08c59bb54f
5 changed files with 49 additions and 19 deletions

View File

@ -8,7 +8,7 @@ test0: bin/back
bin/back templates.txt 47
test1: bin/back
bin/back templates_lv2.txt 49
bin/back templates_lv2.txt 52
bin/back: obj/main.o obj/generation.o obj/display.o obj/base.o obj/hash.o obj/move.o
mkdir -p bin

BIN
bin/back

Binary file not shown.

View File

@ -252,11 +252,13 @@ void parse_one(FILE* ptr, FILE* ptr2, int index) {
configs[index].lines[i] += xres ;
if(j == 7) {
configs[index].westsig *= 2;
configs[index].westsig += xres;
//configs[index].westsig *= 2;
//configs[index].westsig += xres;
configs[index].westsig += pw(2, i) * xres ;
} else if(j == 0) {
configs[index].eastsig *= 2;
configs[index].eastsig += xres;
//configs[index].eastsig *= 2;
//configs[index].eastsig += xres;
configs[index].eastsig += pw(2, i) * xres ;
}
}
};
@ -266,6 +268,7 @@ void parse_one(FILE* ptr, FILE* ptr2, int index) {
printf("-----| Template %d (line %d) |-----\n", index, 9*index);
print_template(index);
printf("sigs : (%d, %d, %d, %d) (N, E, S, W)\n", configs[index].lines[0], configs[index].eastsig, configs[index].lines[7], configs[index].westsig);
printf("\n");
}

View File

@ -1,9 +1,9 @@
1 1 1 1 1 1 1 1
1 0 0 0 0 0 0 1
1 0 0 0 0 0 0 1
1 0 0 0 0 0 0 1
1 0 0 0 0 0 0 1
1 0 0 0 0 0 0 1
1 0 1 1 1 1 0 1
1 0 1 0 0 1 0 1
1 0 1 0 0 1 0 1
1 0 1 1 1 1 0 1
1 0 0 0 0 0 0 1
1 1 1 1 1 1 1 1

View File

@ -1,11 +1,11 @@
1 1 1 1 1 1 1 1
1 0 0 0 0 0 0 1
1 0 1 1 1 1 0 1
1 0 1 0 0 1 0 1
1 0 1 0 0 1 0 1
1 0 1 1 1 1 0 1
1 0 0 0 0 0 0 1
0 1 1 1 1 1 1 0
1 1 1 1 1 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