single-digit cross sum

38 views
Skip to first unread message

Susi Seiber

unread,
Oct 30, 2023, 6:44:25 PM10/30/23
to MiniZinc
How can I form the single-digit cross sum of a number in minizinc? I can't find anything in the tutorial that helps me.
Message has been deleted

Jip Dekker

unread,
Oct 30, 2023, 8:38:40 PM10/30/23
to MiniZinc
There is no function in the standard library to compute the cross sum of a number, but it can be easily written in MiniZinc using the arithmetic builtins. You can find builtins for logarithms, exponentiation, and other mathematical operations in the standard library.

(I've removed my original response, as I was made aware that this problem is often a student assignment).

Good luck!

Susi Seiber

unread,
Nov 1, 2023, 6:58:46 PM11/1/23
to MiniZinc
Hi Jip
I'm not a student.
I am a 69 year old geocacher, I was looking for this function to solve a geocach.
https://coord.info/GC6A1P2
Anyway, thank you very much for your answer.

Jip Dekker

unread,
Nov 1, 2023, 7:03:33 PM11/1/23
to MiniZinc
Sorry, I didn't mean to accuse you of anything. I was just made aware that this problem is often part of assignments, and since this mailing list is publicly accessible and there are various MiniZinc courses, so I didn't want to leave it for google to index it.

I assume you would have still received the initial response I wrote, otherwise feel free to send me a email directly and I'll be happy to help you further.
Good luck with the cache!

Susi Seiber

unread,
Nov 2, 2023, 8:31:52 PM11/2/23
to MiniZinc
No problem
I was now able to solve it with Excel. Four numbers were clear based on the Swissgrid coordinates, the others via trial and error until it worked.
Thank you again for the support.
Reply all
Reply to author
Forward
0 new messages