Doing a KenKen in Wolfram Language

I think that this is amazing code! :slight_smile:

I recently came across even more amazing code, in another language - APL.
Sorry for the digression, but it solves KenKen in about 20 lines of insanely dense code. Here you go…

z?n fillcage x;t;o;c;k;f;m;at;z1;z2 ? we have to search and place the number
t o c?x
f?{|???,o,?} ? executes char operation in a function
at?{a?(n×n)?0 ? a[(,?n n)??]?? ? n n?a} ? Places numbers ? in the cells ?
k??¯1+?c
:If o=’ ’
z??c at t
:Else
m?(?n)({??.f ?}?k)?n ? All possible combinations
:If ~o=‘÷’
z?c?at¨(t=,m)/,??m ? The coords of the cells that make the target #
:Else
z1?c?at¨(t=,m)/,??m ? For division we need to check the reciprocal too
z2?c?at¨((÷t)=,m)/,??m
z?z1,z2
:EndIf
:EndIf

z?kenken x;n;sum
n?0.5*???,/x[;3] ? dimension of the KenKen
sum?{a?,??.+? ? f?{?/{{???}?~0}¨??} ? a/?(f¨?¨a)?f¨a}
z???sum/n?fillcage¨?x