Share Pastebin
Guest
Public paste!

Common Lisp version of the MaxParts function

By: a guest | Mar 19th, 2010 | Syntax: Lisp | Size: 0.17 KB | Hits: 64 | Expires: Never
Copy text to clipboard
  1. (defun MaxParts (Dimension Cuts)
  2.   (if (>= D C)
  3.     (expt 2 C)
  4.     (if (= D 0)
  5.       1
  6.       (if (= C 0)
  7.         1
  8.         (+ (mp (- D 1) (- C 1)) (mp D (- C 1)))))))