Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Post Code

Name: Anonymous 2011-03-04 21:33

One recurring complaint is that nobody talks about code on /prog/. So everyone write go and write some code, any code, that does something, anything, and post it. A small explanation wouldn't go amiss either.

Name: Anonymous 2011-03-05 23:38

Tried my first bit of lisp just now; googled the syntax for ifs and functions then wrote this..
(defun factorial (num) (if (> num 1) (* num (factorial (- num 1))) 1))

Should probably work on my formatting, just don't really know the normal style for lisp. I imagine it's something like..
(defun factorial (num)
        (if (> num 1)
                (* num (factorial
                        (- num 1)))
                1))

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List