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

Pages: 1-

/prog/ is dying

Name: Anonymous 2012-12-09 22:36

you sick FUCKS

Name: Anonymous 2012-12-09 22:36

LE REDDIT FACE
xD

Name: Anonymous 2012-12-09 22:39

PROG CHALLENGE [HARD]

IMPLEMENT THE FOLLOWING MORE ELEGANTLY:

http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/code/fun/life.cl

Name: Anonymous 2012-12-09 22:41

conway's game of dicks

Name: Anonymous 2012-12-09 23:19

( ͡; ͟ʖ ͡;)   and it was never good

Name: Anonymous 2012-12-09 23:23

(  ͡;  ͟ʖ  ͡; )

Name: Anonymous 2012-12-09 23:33

>>3
Wasn't this in Lain?

Name: Anonymous 2012-12-09 23:59

>>7
yes

Name: Anonymous 2012-12-10 2:03

>>3
I puked a little in my mouth reading that implementation.

Name: Anonymous 2012-12-10 3:08

>>9
I know, isn't it wonderful?

Name: Anonymous 2012-12-10 3:14

>>7
And when she reads it, it's displayed in a proportional font!

Name: Anonymous 2012-12-10 5:15

>>3
No borders and no indices, turned out way uglier than I set it out to be because I got lazy:


(define test
 '((0 0 0 0 0 0 0 0)
   (0 0 0 1 1 0 1 0)
   (0 0 1 0 1 0 1 0)
   (0 0 1 1 1 0 0 0)
   (0 1 0 0 1 1 1 0)
   (0 1 1 1 0 0 0 0)
   (0 0 0 1 1 0 1 0)
   (0 0 0 0 0 0 0 0)))

(define (shiftl l)
  `(,@(cdr l) ,(car l)))

(define (shiftr l)
  `(,(last l) ,@(reverse (cdr (reverse l)))))

(define (combine . xs)
  (cond
    ((foldl (λ (a b) (or a b)) #f (map null? xs)) null)
    ((foldl (λ (a b) (and a b)) #t (map (λ (x) (not (list? x))) xs)) (apply list xs))
    (else (cons (apply combine (map car xs)) (apply combine (map cdr xs))))))

(define (neighbors m)
  (let ((top (shiftr m))
        (middle m)
        (bottom (shiftl m)))
    (map (λ (r) (map (λ (l) (foldl (λ (v i) (+ v i)) 0 l)) r)) (combine (map shiftl top) top (map shiftr top) (map shiftl middle) (map shiftr middle) (map shiftl bottom) bottom (map shiftr bottom)))))

(define (conway cell neighbor-count)
  (cond
    ((= neighbor-count 3) 1)
    ((and (= 1 cell) (= neighbor-count 2) 1))
    (else 0)))

(define (tick m)
  (map (λ (l) (map (curry apply conway) l)) (combine m (neighbors m))))

(define (show m)
   (for-each (λ (l) (begin (for-each (λ (e) (display (if (= e 1) "*" " "))) l) (newline))) m))

(define (life time torus)
  (let loop ((gen 0) (t torus))
    (unless (= gen time)
      (printf "Generation ~s\n" gen)
      (show t)
      (loop (add1 gen) (tick t)))))

Name: Anonymous 2012-12-10 5:44

>>12
Use vectors!

Name: Anonymous 2012-12-10 5:53

>>13
I wanted to use lists, if I want to do things with arrays I use C.

Name: Anonymous 2012-12-10 6:14

>>14
No, you've got it wrong. The data types you use should be determined by purpose, not language.

Name: Anonymous 2012-12-10 6:51

>>15
I just wanted to do it in a cute way. I know what the boring answer would look like.

Name: Anonymous 2012-12-10 7:04

>>16
You are forgiven. The gods will not haunt you tonight. I like how you used λ also.

Name: Anonymous 2012-12-10 17:13

>>5
U MENA /b/

Name: Anonymous 2012-12-11 4:03

hey
hey guys
I just saw this cool new même on the imageboards

*whips out dick*

Name: Anonymous 2012-12-11 6:10

[spoiler]/prog/[spoiler] is devolving, not dying.

Name: Anonymous 2012-12-11 8:42

>>20
Especially due to BBcode failures.

Name: Anonymous 2012-12-12 8:25

Minecraft confirms it

Name: Anonymous 2012-12-13 6:27

...3d would be better. ...and not in stutter. omg

Name: Anonymous 2013-09-01 13:53



            ,ヘr/'!_,..-─- 、.,_
           ri:::;ゝ'´=-..,,__   `ヽ.
          くン´      `ヽ.、  ヽ.
           / , / 、_ i  ,  ヽ!   ',
          く_/、 」ォ、!/! ./l_,.!- ハ   i
           //.7.ゞ'└'ァr-ォ Li_」  i
          く/ .ヘ  ' ___ ゞ'´/ / ハ !
           `.!/`>、'  ) ,.イ、/!、/ !」
              ̄ ヾ' ̄く/ `ヽ.>ヽ
                く!/      !ヽト、
                ゝ!、  ァ'"ヽ:::', ヽ.
         -==ニニ二く!/`'ーへ.   ヽ.! /_
                 <::::::::::::::〉  /!´ー'     i
─-- ..,,,,__          .r/7`'ー/  ./「       ハ
`"'' ─-- 二_"__'' ─-- ::;;;____「|_,/  /::::ハ      / .ノ
           ̄r.ア"'':ー--| l.  ,iニニ⊃ヽ     i (
           r<:::::/::::::::::l.」ー‐'::::::/::::ム〉>、    i `ヽ.
           7''>rヽ二ゝ、:::::::::::::::/::::;:イン    ノ   |
          `7'ー'' ̄`_rァ'-、__.イ/ン´  ,. '"  ̄ `ヽ.  i
          .!,ゝ、_、_,./  .,.-r'ー'7   ,' ,.     、   i
          /  /    |i::;イ'7    i ・    ・   i
      ,.-‐ r'ー-ン      ヽ--'     ', ヽ-' ー'   /
      |i:::;イ`ー'7               ヽ、.,_______,,. '
      ヽ、__ニン

Name: Anonymous 2013-09-01 15:24



           _,,,...,,_
         ,.:く:::::::::::::::\
        ,:'_;;:>-‐::ァ':::':,    /´`ヽ、 ,. -─- 、
         /:::::::::::::::::::/:::::::::';  ,. - 、_,,.メ.,__    \
       ;:-\_::イ::::::::::::::_;ハ/  _,..,_     `ヽ
       |:::::::::> ''"´ ̄ ̄ `''<´   `' 、   }
       l, '´/    、     `' 、    ':,  /
      /   ;     ハ‐-ヽ、    ヽ }   }
    .,:' .  /{    ./_」ニ=t、ハ     ハノ   ;
    / ./  /__ト、  ;'ァ' lh ,ハノl|  ,  | '   /
   .'  ;  ;' _」_ \|   ゝ-゚' ,./  /  ; |  ;
   !  {  l!´lhハ        ∠ イ  |/ ;'  {
   ',  \ ハ ゝ゚`   ノ    /  ,ハ ∧  '、
    \  `>"   ー'´    ,'  ,.'  ;' ':、  \
     ∨ | 人         ; .// /   ',   ヽ
      /{   |>, 、  _,,. レ'ム,イ /    }     ':,
      ,' '   !/ | `てlハ  _/ `ァ─- 、 /  }   }
      レ'´ \{  '、| r'八 ̄   /  /   ヽ./   ./
             _/{ト-r-= '"    .|/    \ /
           ;'´ {/ / {      /       ,
           ; |/ /_  }     ;        }
          , .,' ;:'"::::::':,{    /´)     |/
          / ' .{:::::::::::::;l!   / ´-ヽ    ,'
         ;'  {/ ゙' ー ''"リ  _r;'  _-、_)  /
        r'{ /}     ///!  ノ    /
        { ヽ.,/ _,,.. -''"  { { イ     /{ヽ

Name: Anonymous 2013-11-30 8:08

░░░░░░░▄▀▀▀▀▀▀▀▀▀▀▄▄░░░░░░░░░
░░░░▄▀▀░░░░░░░░░░░░░▀▄░░░░░░░
░░▄▀░░░░░░░░░░░░░░░░░░▀▄░░░░░ YOU HAVE BEEN VISITED BY
░░█░░░░░░░░░░░░░░░░░░░░░▀▄░░░ LE 'FEEL OF NO GF
░▐▌░░░░░░░░▄▄▄▄▄▄▄░░░░░░░▐▌░░
░█░░░░░░░░░░░▄▄▄▄░░▀▀▀▀▀░░█░░ A qt 3.14 gf will come to you,
▐▌░░░░░░░▀▀▀▀░░░░░▀▀▀▀▀░░░▐▌░ but ONLY if you post a
█░░░░░░░░░▄▄▀▀▀▀▀░░░░▀▀▀▀▄░█░ `>tfw no GF on this thread
█░░░░░░░░░░░░░░░░▀░░░▐░░░░░▐▌
▐▌░░░░░░░░░▐██▀█▄░░░░░░█▀█░▐▌
░█░░░░░░░░░░░▀▀▀░░░░░░▀▀▀▀░▀▄
░▐▌░░░░▄░░░░░░░░░░░░░▌░░░░░░█
░░▐▌░░▐░░░░░░░░░░░░░░▀▄░░░░░█
░░░█░░░▌░░░░░░░░▐▀░░░░▄▀░░░▐▌
░░░▐▌░░▀▄░░░░░░░░▀░▀░▀▀░░░▄▀░
░░░▐▌░░▐▀▄░░░░░░░░░░░░░░░░█░░
░░░▐▌░░░▌░▀▄░░░░▀▀▀▀▀▀░░░█░░░
░░░█░░░▀░░░░▀▄░░░░░░░░░░▄▀░░░
░░▐▌░░░░░░░░░░▀▄░░░░░░▄▀░░░░░
░▄▀░░░▄▀░░░░░░░░▀▀▀▀█▀░░░░░░░

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