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

Pages: 1-

programming is art

Name: Anonymous 2010-10-08 18:15

1

funC :: Int -> String
funC n | n < 1     = error "HAX MY ANUS"
       | otherwise = "void (*f)(" ++ funC' (n - 1) ++ ")"
           where funC' 0 = "void"
                 funC' n = "void (*)(" ++ funC' (n - 1) ++ ")"


2

*Main> funC 100
"void (*f)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)                                              (void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(                                              void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(v                                              oid (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(vo                                              id (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(voi                                              d (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void                                               (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void                                               (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (                                              *)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*                                              )(void))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))"


3

cdecl> explain void (*f)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void (*)(void))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))
declare f as pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function  (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (pointer to function (void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning void) returning voi
d) returning void


your turn

Name: Anonymous 2010-10-08 18:23

I don't know.

Name: Anonymous 2010-10-08 18:27

voi                                              d
Never heard of this type.

Name: Xarn 2010-10-08 18:28

>>3
I blame shiitchan

Name: Anonymous 2010-10-08 20:27

C's syntax is very elegant and fun. Only to be rivaled by other langauges like lisp(I had to say lisp since my friend would yell at me if I didn't >.<)

Name: Anonymous 2010-10-08 20:41

C's syntax is very elegant
W-|

Name: Anonymous 2010-10-08 22:24

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░▄▀▄░░░░░░░░░░░░░░░
░░░░░░░░░░░░░▄▀░░░▀▄░░░░░░░░░░░░░
░░░░░░░░░░░▄▀░░░░▄▀█░░░░░░░░░░░░░
░░░░░░░░░▄▀░░░░▄▀░▄▀░▄▀▄░░░░░░░░░
░░░░░░░▄▀░░░░▄▀░▄▀░▄▀░░░▀▄░░░░░░░
░░░░░░░█▀▄░░░░▀█░▄▀░░░░░░░▀▄░░░░░
░░░▄▀▄░▀▄░▀▄░░░░▀░░░░▄█▄░░░░▀▄░░░
░▄▀░░░▀▄░▀▄░▀▄░░░░░▄▀░█░▀▄░░░░▀▄░
░█▀▄░░░░▀▄░█▀░░░░░░░▀█░▀▄░▀▄░▄▀█░
░▀▄░▀▄░░░░▀░░░░▄█▄░░░░▀▄░▀▄░█░▄▀░
░░░▀▄░▀▄░░░░░▄▀░█░▀▄░░░░▀▄░▀█▀░░░
░░░░░▀▄░▀▄░▄▀░▄▀░█▀░░░░▄▀█░░░░░░░
░░░░░░░▀▄░█░▄▀░▄▀░░░░▄▀░▄▀░░░░░░░
░░░░░░░░░▀█▀░▄▀░░░░▄▀░▄▀░░░░░░░░░
░░░░░░░░░░░░░█▀▄░▄▀░▄▀░░░░░░░░░░░
░░░░░░░░░░░░░▀▄░█░▄▀░░░░░░░░░░░░░
░░░░░░░░░░░░░░░▀█▀░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

Name: Anonymous 2010-10-08 22:34

>>1
I was feeling kind of down, but this made my day. Thank you.

Name: Anonymous 2010-10-09 4:45

What I don't like about C is how it's apparently close to the metal (i.e., every statement or operation can be viewed as one or few machine instructions), but actually, a lot of the time it isn't.

Name: Anonymous 2010-10-09 4:49

if 1:
 if 1:
  if 1:
   if 1:
    if 1:
     if 1:
      if 1:
       if 1:
        if 1:
         if 1:
          if 1:
           if 1:
            if 1:
             if 1:
              if 1:
               if 1:
                if 1:
                 if 1:
                  if 1:
                   if 1:
                    if 1:
                     if 1:
                      if 1:
                       if 1:
                        if 1:
                         if 1:
                          if 1:
                           if 1:
                            pass
                           pass
                          pass
                         pass
                        pass
                       pass
                      pass
                     pass
                    pass
                   pass
                  pass
                 pass
                pass
               pass
              pass
             pass
            pass
           pass
          pass
         pass
        pass
       pass
      pass
     pass
    pass
   pass
  pass
 pass
if 1:
 if 1:
  if 1:
   if 1:
    if 1:
     if 1:
      if 1:
       if 1:
        if 1:
         if 1:
          if 1:
           if 1:
            if 1:
             if 1:
              if 1:
               if 1:
                if 1:
                 if 1:
                  if 1:
                   if 1:
                    if 1:
                     if 1:
                      if 1:
                       if 1:
                        if 1:
                         if 1:
                          if 1:
                           if 1:
                            pass
                           pass
                          pass
                         pass
                        pass
                       pass
                      pass
                     pass
                    pass
                   pass
                  pass
                 pass
                pass
               pass
              pass
             pass
            pass
           pass
          pass
         pass
        pass
       pass
      pass
     pass
    pass
   pass
  pass
 pass

Name: Anonymous 2010-10-09 5:33

>>9
Well those statements that aren't are the declarations we don't generate code, just the internals of the program

Name: Anonymous 2010-10-09 5:46

Why the fuck doesn't the c preprocessor support the spawning of programs to aid in code generation in the style of OPs


eg


#include <stdio.h>

// define helloworld0 through helloworld9
#run ruby
0.upto(9) { |i|
  puts "int helloworld#{i}();"
}
#endrun


[/code]

Name: Anonymous 2010-10-09 5:50

>>12
Because it sucks also using strings is a poor form of code generation, but that hasn't stopped it being the main form on the web

Name: Anonymous 2010-10-09 5:58

# Project Euler 1
import sys; sys.setrecursionlimit(30000)

L = eval; _ = lambda s: L(s.replace("/",  "lambda ")
                           .replace("->", "and ")
                           .replace("<-", "or "))

S =_ ('/x:/v: globals().update({x:v}) ')
P =_ ('/x:    sys.stdout.write(str(x))')
B =_ ('/f:/g: 0                       ')

A =_ ('/a:/b: a + b '); M =_ ('/a:/b: a % b ');E =_ ('/a:/b: a == b')
N =_ ('/x:/v:    (S) (x)((A) ((L)  (x))(v))  # <- (F)(v)(x) (N)    ')
F =_ ('/s:/t:/d: (E) (s) (t)<-(B) ((d) (s))((F)  ((A)(s)(1))(t)(d))')
D =_ ('/a:/b:    (E)((M) (a)  (b)) (0)  #  ((B)  ((M)(a)(b))(F))#  ')
T =_ ('/t:/a:    (A)((D) (a)  (3))((D) (a)  (5))->(N)(t)(a)  # (a) ')

(B)((B)((S)("t")(0))((F)(0)(1000)((T)("t"))))((B)((P)(t))((P)("\n")))

Name: Anonymous 2010-10-09 6:12

>>13
s/web/PHP/

Name: Anonymous 2011-02-03 2:23

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