Rätsel mit Programmierung lösen?
Ich habe dieses Rätsel und möchte alle möglichen Kombinationen herausfinden, die Teile zusammenzusetzen. Man darf alle Teile drehen, außer das mit dem Pfeil (der Pfeil muss nach oben zeigen).
Ich habe es selbst probiert, bin bei einer sechsfach verschachtelten for-Schleife gelandet und bin jetzt suizidgefährdet.
Kann mir bitte wer einen besseren Ansatz/Algorithmus sagen? Am liebsten wäre mir als Sprache C#, aber alle Sprachen sind mir recht, auch Pseudocode.
Could you please share the whole PDF file?
https://ftp.heise.de/ct/listings/2023/15/3x3_ra_tsel_final.pdf
Do you know the solution?
Thank you, I’ll look at it later.
I’ve just changed the if condition by testing, but now I’ve shut down the laptop. If you were time and pleasure it would be nice if you could edit the program again, but it’s not a problem if you don’t like it.
That’s funny, what have you changed?
Uh, I just tried to edit it with my limited C++ keys and my laptop is frozen after I ran it. It’s probably my fault.
Hmm, right. Yesterday the code went a bit because I learned for a exam.
Yes, but the query “puzzle.size() == used.size()” compares only the size of the vectors and whether it is true or false is not observed.
Yeah, but that’s what it is. This means that each puzzle part is initially marked as “not used”. In the course of the program they are then set as true.
Does the line “std::vector used(puzzlePieces.size(), false);” not fill the vector with as many false as puzzle pieces? If I could have misinterpreted, I’ve never seen this syntax. At the first call of testSolutions(), it would break off directly.
So actually not because the size of the vector “puzzle” does not always match the size of the vector “used”.
(No idea if I misinterpret your question)
I don’t know very well with C++, but the first if-statement in testSolutions is not always true because a list with only false with the same length as puzzlePieces is handed over.
Thanks for the star!
https://pastebin.com/raw/417LfHR8
If you have any questions about the code, please ask
Thank you very much.
Then I could send you my code.
I put the question wrong, yes it should be exactly one way.
My code says there is a possibility. I don’t know if my code is true.
The edge parts are only connected to other parts on 2 sides, but somehow all parts have to fit together.
I kind of don’t have a solution approach. It is impossible to connect all puzzle pieces because each 4 pages has “tops” or not=
Unfortunately not.