Subdomain Posts
C# | 476 days ago
None | 492 days ago
None | 492 days ago
Lisp | 508 days ago
None | 511 days ago
Python | 513 days ago
Lisp | 513 days ago
Lisp | 513 days ago
None | 545 days ago
None | 580 days ago
Recent Posts
Python | 20 sec ago
Python | 23 sec ago
None | 27 sec ago
HTML | 36 sec ago
mIRC | 43 sec ago
None | 47 sec ago
None | 49 sec ago
None | 51 sec ago
C# | 51 sec ago
Bash | 1 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
Learn a little bit about the new Pastebin.com on our help page. hide message
By free-zombie on the 27th of Oct 2008 10:37:56 PM Download | Raw | Embed | Report
  1. (defun with-unique-digits (to)
  2.   (let ((ndigits (ceiling (log to 10))))
  3.     (find-uniques to () ndigits 0)
  4.     ))
  5.  
  6.  
  7. (defun find-uniques (max forbidden ndigits add)
  8.   (cond
  9.     ((> add max) ())
  10.     ((= ndigits 0) (list add))
  11.     (t (append
  12.         (if (member 0 forbidden) ()
  13.             (find-uniques max (and forbidden (cons 0 forbidden)) (1- ndigits) add))
  14.         (loop for i from 1 to 9
  15.          append (if (member i forbidden) ()
  16.                  (find-uniques max (cons i forbidden) (1- ndigits)
  17.                                (+ add (* i (expt 10 (1- ndigits))))))
  18.              )
  19.          ))
  20.     ))
Submit a correction or amendment below. Make A New Post
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: