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

Plagiarized challenge for /prgo/

Name: Anonymous 2011-12-28 10:48

Someone posted a challenge for perl6, and one of those challenges is this->
http://strangelyconsistent.org/p6cc2011/t1-description

I recognize that I HAVE NO FUCKING IDEA HOW TO START...
So, let's plagiarize this and start a good challenge for /porg/, but with these rules

* Any language u want
* 50 LOC maximum (unless is asm)

Name: Anonymous 2011-12-28 12:58

>>8
I didn't save it, it is just bruteforce, though. The main loop was something like this:
(let ((1op '(+ -)) (2op ('+ - mod div *)) (op1 (lambda (x) `(,x 9))) (op2 (lambda (f g) (lambda (x y) `(,f (,g ,x ,y))))))
  (append*
   (for*/list ((o1 1op) (o2 1op) (o3 1op)
               (o4 1op) (o5 1op) (o6 1op) (o7 1op)
               (f 2op) (g 2op) (h 2op))
     (let ((x (op1 o1)) (y (op1 o2)) (z (op1 o3)) (w (op1 o4))
           (f (op2 o5 f)) (g (op2 o6 g)) (h (op2 o7 h)))
       (list (f (g (h x y) z) w)
             (f (g x (h y z)) w)
             (f x (g (h y z) w))
             (f x (g y (h z w)))))))

Then the generated code was evaled, with mod and div returning 0 on bad inputs, filter non-exact-positive-integers, remove expressions with the same result, sort, pretty print.

Name: Anonymous 2011-12-28 13:00

>>8
I didn't save it, it is just bruteforce, though. The main loop was something like this:
(let ((1op '(+ -)) (2op ('+ - mod div *)) (op1 (lambda (x) `(,x 9))) (op2 (lambda (f g) (lambda (x y) `(,f (,g ,x ,y))))))
  (append*
   (for*/list ((o1 1op) (o2 1op) (o3 1op)
               (o4 1op) (o5 1op) (o6 1op) (o7 1op)
               (f 2op) (g 2op) (h 2op))
     (let ((x (op1 o1)) (y (op1 o2)) (z (op1 o3)) (w (op1 o4))
           (f (op2 o5 f)) (g (op2 o6 g)) (h (op2 o7 h)))
       (list (f (g (h x y) z) w)
             (f (g x (h y z)) w)
             (f x (g (h y z) w))
             (f x (g y (h z w)))))))

Then the generated code was evaled, with mod and div returning 0 on bad inputs, filter non-exact-positive-integers, remove expressions with the same result, sort, pretty print.

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