Recent public codes are listed below. You can filter them by the following programming languages:
- view
- All
- Ada
- Assembler
- Assembler
- AWK (gawk)
- AWK (mawk)
- Bash
- bc
- Brainf**k
- C
- C#
- C++
- C++0x
- C99 strict
- CLIPS
- Clojure
- COBOL
- COBOL 85
- Common Lisp (clisp)
- D (dmd)
- Erlang
- F#
- Factor
- Falcon
- Forth
- Fortran
- Go
- Groovy
- Haskell
- Icon
- Intercal
- Java
- JavaScript (rhino)
- JavaScript (spidermonkey)
- Lua
- Nemerle
- Nice
- Nimrod
- Objective-C
- Ocaml
- Oz
- Pascal (fpc)
- Pascal (gpc)
- Perl
- Perl 6
- PHP
- Pike
- Prolog (gnu)
- Prolog (swi)
- Python
- Python 3
- R
- Ruby
- Scala
- Scheme (guile)
- Smalltalk
- SQL
- Tcl
- Text
- Unlambda
- VB.NET
- Whitespace
-
1
(* 3 4)
-
1
(times-two 5)
-
1 2 3 4 5 6 7 8 9
(defun n-words-with-width-less-than (words fontsize length &optional (accum nil)) "The first N words with a combined fontwidth (including spaces) less than the width required." (if (<= (* fontsize (+ (length accum) ;;Add the spaces. -1 ;;Minus one, since the last word needs no space after it. (apply #'+ (mapcar #'length accum))));;Total width of the words length) (if (null words) accum (n-words-with-width-less-than (cdr words) fontsize length (cons (car words) accum)))
...
-
1
(max 45 56 71 89)
-
1
(* 2 (cos 0) (+ 4 6))
-
1 2 3 4 5 6 7 8 9
(defun n-words-with-width-less-than (words fontsize length &optional (accum nil)) "The first N words with a combined fontwidth (including spaces) less than the width required." (if (<= (* fontsize (+ (length accum) ;;Add the spaces. -1 ;;Minus one, since the last word needs no space after it. (apply #'+ (mapcar #'length accum))));;Total width of the words length) (if (null words) accum (n-words-with-width-less-than (cdr words) fontsize length (cons (car words) accum)))
...
-
1 2 3 4 5 6 7 8 9
(defun n-words-with-width-less-than (words fontsize length &optional (accum nil)) "The first N words with a combined fontwidth (including spaces) less than the width required." (if (<= (* fontsize (+ (length accum) ;;Add the spaces. -1 ;;Minus one, since the last word needs no space after it. (apply #'+ (mapcar #'length accum))));;Total width of the words length) (if (null words) accum (n-words-with-width-less-than (cdr words) fontsize length (cons (car words) accum)))
...
-
1 2 3 4 5 6 7 8 9
(defun n-words-with-width-less-than (words fontsize length &optional (accum nil)) "The first N words with a combined fontwidth (including spaces) less than the width required." (if (<= (* fontsize (+ (length accum) ;;Add the spaces. -1 ;;Minus one, since the last word needs no space after it. (apply #'+ (mapcar #'length accum))));;Total width of the words length) (if (null words) accum (n-words-with-width-less-than (cdr words) fontsize length (cons (car words) accum)))
...
-
1 2 3 4 5 6 7 8 9
(defun n-words-with-width-less-than (words fontsize length &optional (accum nil)) "The first N words with a combined fontwidth (including spaces) less than the width required." (if (<= (* fontsize (+ (length accum) ;;Add the spaces. -1 ;;Minus one, since the last word needs no space after it. (apply #'+ (mapcar #'length accum))));;Total width of the words length) (if (null words) accum (n-words-with-width-less-than (cdr words) fontsize length (cons (car words) accum)))
...
-
1 2 3 4 5 6 7 8 9
(defun n-words-with-width-less-than (words fontsize length &optional (accum nil)) "The first N words with a combined fontwidth (including spaces) less than the width required." (if (<= (* fontsize (+ (length accum) ;;Add the spaces. -1 ;;Minus one, since the last word needs no space after it. (apply #'+ (mapcar #'length accum))));;Total width of the words length) (if (null words) accum (n-words-with-width-less-than (cdr words) fontsize length (cons (car words) accum)))
...
-
1 2 3 4 5 6 7 8 9
(defun prime? (n) (loop for i from 2 to (/ n 2) do (when (= (mod n i) 0) (return-from prime? NIL))) T) (defun take-n-primes (n) (labels ((next-prime (current) (loop for i from (1+ current) do
...
-
1 2 3 4 5 6 7 8 9
(defpackage :enumerate-ips (:use :cl) (:export #:enumerate-ips)) (in-package :enumerate-ips) (defun split-by (str sep) (let ((prev-sep 0) (res '()))
...
-
1 2 3 4 5 6 7 8 9
(defpackage :enumerate-ips (:use :cl) (:export #:enumerate-ips)) (in-package :enumerate-ips) (defun split-by (str sep) (let ((prev-sep 0) (res '()))
...
-
1 2 3 4 5 6 7 8 9
(defun primep (num it) (if (or (= it 1) (= num 1)) t (unless (zerop (mod num it)) (primep num (1- it))))) (defun coll-primep (num &optional (n 2) (x 0)) (if (= x num) () (if (primep n (1- n))
...
-
1 2 3 4 5 6 7 8 9
(defun prime-collect (num) (flet ((primep (num) (if (> num 1) (loop for a from 2 to (isqrt num) never (zerop (mod num a)))))) (flet ((next-prime (num) (loop for a from num when (primep a) return a)))
...
-
1 2 3 4 5 6 7 8 9
(defun prime-collect (num) (flet ((primep (num) (if (> num 1) (loop for a from 2 to (isqrt num) never (zerop (mod num a)))))) (flet ((next-prime (num) (loop for a from num when (primep a) return a)))
...
-
1 2 3 4 5 6 7 8 9
(defun primep (num it) (if (or (= it 1) (= num 1)) t (unless (zerop (mod num it)) (primep num (1- it))))) (defun coll-primep (num &optional (n 2) (x 0)) (if (= x num) () (if (primep n (1- n))
...
-
1 2 3 4 5 6 7 8 9
(defun primep (num it) (if (or (= it 1) (= num 1)) t (unless (zerop (mod num it)) (primep num (1- it))))) (defun coll-primep (num &optional (n 2) (x 0)) (if (= x num) () (if (primep n (1- n))
...
-
1 2 3 4 5 6 7 8 9
(defun primep (num it) (if (or (= it 1) (= num 1)) t (unless (zerop (mod num it)) (primep num (1- it))))) (defun coll-primep (num &optional (n 2) (x 0)) (if (= x num) () (if (primep n (1- n))
...
-
1 2 3 4 5 6 7 8 9
(defun primep (num it) (if (or (= it 1) (= num 1)) t (unless (zerop (mod num it)) (primep num (1- it))))) (defun coll-primep (num &optional (n 2) (x 0)) (if (= x num) () (if (primep n (1- n))
...
-
1 2 3 4 5 6 7 8 9
(defun primep (num it) (if (or (= it 1) (= num 1)) t (unless (zerop (mod num it)) (primep num (1- it))))) (defun coll-primep (num &optional (n 2) (x 0)) (if (= x num) () (if (primep n (1- n))
...
-
1 2 3 4 5 6 7 8 9
(defun prime-collect (num) (flet ((primep (num) (if (> num 1) (loop for a from 2 to (isqrt num) never (zerop (mod num a))))) (next-prime (num) (loop for a from num when (primep a) return a)))
...
-
1 2 3 4 5 6 7 8 9
;;Solution to facebook hacker cup Billboard brain teaser. ;;author: sea <http://sea4ever.users.sourceforge.net> ;; This program is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
...
-
1 2 3 4 5 6 7 8 9
(defun f (num) (labels ((iter (num x res) (if (= res x) () (if (labels ((fun (num it) (if (or (= it 1) (= num 1)) t (if (zerop (mod num it)) ()
...
-
1 2 3 4 5 6 7 8 9
(defun prime? (n) (loop for i from 2 to (/ n 2) do (if (= (mod n i) 0) (return-from prime? NIL))) T) (defun find-n-primes (n) (labels ((next-prime (current) (loop for i from (1+ current) do
...
-
1 2 3 4 5 6 7 8 9
(defun f (num) (labels ((iter (num x res) (if (= res x) () (if (labels ((fun (num it) (if (or (= it 1) (= num 1)) t (if (zerop (mod num it)) ()
...
-
1 2 3 4 5 6 7 8 9
(defun f (num) (labels ((iter (num x res) (if (= res x) () (if (labels ((fun (num it) (if (or (= it 1) (= num 1)) t (if (zerop (mod num it)) ()
...
-
1 2 3 4 5 6 7 8 9
(defun f (num) (labels ((iter (num x res) (if (= res x) () (if (labels ((fun (num it) (if (or (= it 1) (= num 1)) t (if (zerop (mod num it)) ()
...
-
1 2 3 4 5 6 7 8 9
(defun f (num) (labels ((iter (num x res) (if (= res x) () (if (labels ((fun (num it) (if (or (= it 1) (= num 1)) t (if (zerop (mod num it)) ()
...
-
1 2 3 4 5 6 7 8 9
(defun f (num) (labels ((iter (num x res) (if (= res x) () (if (labels ((fun (num it) (if (or (= it 1) (= num 1)) t (if (zerop (mod num it)) ()
...


