Anonymous user
Cut a rectangle: Difference between revisions
m
→optimized: simplified the code in the SOLVE function.
(→optimized: added some optimizations, incorporated a formula for calculating the number of cuts when M is even and N is equal to 3.) |
m (→optimized: simplified the code in the SOLVE function.) |
||
Line 2,831:
solve: procedure expose # @. dir. h len next. w; @.= 0 /*zero rectangle coördinates.*/
parse arg h,w,recur /*get values for some args. */
if w==
if h//2 then do; t= w; w= h; h= t; if h//2 then return 0
end
|