JamesBremner / so76407006

Code for https://stackoverflow.com/q/76407006/16582
1 stars 0 forks source link

Every combined cell must be reachable from starter via combined cells. #2

Open orielswisa opened 1 year ago

orielswisa commented 1 year ago

After I successfully run your project, I understand your approach and it seems really good. But there is some situation that I should address such as this: image

JamesBremner commented 1 year ago

I am guessing that you are concerned that the cell combination is split into two unconnected components by the forbidden cells. Please confirm.

orielswisa commented 1 year ago

Yes.

orielswisa commented 1 year ago

This is also a bad situation: image

For example this the wanted result: image

these are good also: image image

JamesBremner commented 1 year ago

I have added a check that every combination is connected.

This uses the Dijkstra algorithm from https://github.com/JamesBremner/PathFinder.

orielswisa commented 1 year ago

I can't build it right now. My Idea is to create a polygon for each cell combination that we get and then check which one of the polygons is the one that contains the start cell. I think it will be more efficient.

JamesBremner commented 1 year ago

I can't build it right now.

Why not?

orielswisa commented 1 year ago

I'm struggling with adding the PathFinder project. somehow your makefile not working for me. So I create my own using GPT for the first time, but right now I don't know what should I add.

JamesBremner commented 1 year ago

"somehow your makefile not working for me."

Somehow?

I can help you sort this out, if you give me details. Where is the log file when you run the makefile?

orielswisa commented 1 year ago

I don't know maybe my VS Code is configured different because usually I use python rather than c++. Where the log file should be? and should I need to build the PathFinder project first?

orielswisa commented 1 year ago

and my suggestion with the point inside polygon is faster than using pathfinding algorithm. I wish if I know c++ in your level, to be able to add it by self.

JamesBremner commented 1 year ago

Where the log file should be?

The log file is displayed in the terminal. Please copy and paste it in this thread.

It should look like this

g++  -std=c++17 -g -D_mingw_ \
-c -o .vscode/obj/main.o ./src/main.cpp -I./include -I../windex/include -I../raven-set
g++  -std=c++17 -g -D_mingw_ \
-c -o .vscode/obj/cellCombiner.o ./src/cellCombiner.cpp -I./include -I../windex/include -I../raven-set
g++ -g \
-o bin/starter.exe .vscode/obj/main.o .vscode/obj/cellCombiner.o  \

should I need to build the PathFinder project first?

No. The makefile will build the parts of the pathfinder source that it needs.