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

Divisible by 3 or 5, in lisp

Name: Anonymous 2007-08-12 17:20 ID:RyfBwU/E

(lambda (n) (or (= 0 (mod n 3)) (= 0 (mod n 5))))

how on earth do you write this in lisp, I mean better than I have here.. surely it must be possible?

Rube Goldberg devices are definitely acceptable if it makes the final code better.. hope you have some ideas /prog/

Name: Anonymous 2007-08-12 18:08 ID:UuB0Fh1x

LOL Lisp.
int f(n){(!(n%3) || !(n%5))}

Name: Anonymous 2007-08-12 18:19 ID:+1As6lo3

LOL De Morgan.
int f(n){!(n%3 && n%5)}

Name: Anonymous 2007-08-12 18:23 ID:UuB0Fh1x

>>7
LOL some sort of newfag college undergrad who just finished discrete math. My version is clearly more readable, hence it is superior to yours in every way possible.

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