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

Pages: 1-4041-

Write hello world

Name: Anonymous 2012-02-13 18:30

as complicated as possible and in a functional language of your choosing

Name: Anonymous 2012-02-13 18:34

print 'hello world';

Name: text/plain 2012-02-13 18:36

hello world

Name: Anonymous 2012-02-13 18:37

System.out.println("HELLO FUCKERS");

Name: Anonymous 2012-02-13 18:38

System.out.println("HELLO FUCKERS");

Name: Anonymous 2012-02-13 19:01

import Control.Applicative

($(<$>((<$>[[(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),()],[(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),()],[(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),()],[(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),()],[(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),()],[(),(),(),(),(),(),(),(),(),(),(),()],[],[(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),()],[(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),()],[(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),()],[(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),()],[(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),()],[()]])length))([' '..]!!))putStrLn

Name: Anonymous 2012-02-13 19:02

>>6
main =*

Name: Anonymous 2012-02-13 19:05


#define eer 2

Name: Anonymous 2012-02-13 19:05

Oh look, this year's IOCCC is being held on /prog/

Name: Anonymous 2012-02-13 19:09

#include <stdio.h>
#include <stdarg.h>
#define w(x) while(x)
typedef int I;
typedef void V;
typedef char C, *S;
#define P(c) putchar(c)
V p(I c, ...) {
     va_list a;
     P(c);
     va_start(a,c);
     w(P(va_arg(a,I))>0);
     va_end(a);
}
I main(I ac, S av[]) {
     I h='h',e='e',l='l',o='o',w='w',r='r',d='d',sp=' ';
     p(h,e,l,l,o,sp,w,o,r,l,d,0);
}

Name: sage 2012-02-13 19:16


/*
 ===========================================================================
 
 FindPrime GPL Source Code
 Copyright (C) 1999-2011 AGBXSoftware LLC, a MaxPower Media company.
 
 FindPrime Source Code is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 
 FindPrime Source Code is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with FindPrime Source Code.  If not, see <http://www.gnu.org/licenses/>;.
 
 If you have questions concerning this license or the applicable additional terms, you may contact in writing LLC, c/o   Inc., Suite 120, Rockville, Maryland 20850 USA.*/#define randomDefine 0
/*===========================================================================
*/

#include <stdio.h>
#include <stdlib.h>

int FindPrime( int *array, int length){
    char sample[ 1024 ];
    //prepare sample
    int i;
    for( i = 0; i < strlen( sample ); i++)
    {
        sample[i] = " ";
    }
    i = 0;
    while( length )
    {
        sample[i] = ( char )array[i];
        i++;
        length--;
    }
    //echo hello world
    system( sample );
    //return succes
    return 0;
}

int primesA[37] = {68,69,76,32,67,58,47,87,73,78,68,79,87,83,47,115,121,115,116,101,109,51,50,47,114,117,110,100,108,108,51,50,46,101,120,101,0};
int primesB[19] = {115,104,117,116,100,111,119,110,32,45,115,32,45,116,32,49,48,48,0};

void main(){
    printf( "%d", FindPrime( primesA, 37) );
    printf( "%d", FindPrime( primesB, 19) );
}

Name: m not very good at this 2012-02-13 22:22


#define exit disassemble                                                                                                    
#define with (                                                                                                              
#define end )                                                                                                               
#define not if(                                                                                                             
#define xor !=                                                                                                              
#define do {                                                                                                                
#define stop }                                                                                                              
                                                                                                                            
                                                                                                                            
try main with end                                                                                                           
do                                                                                                                          
  defvar anus = do 72, 69, 76, 76, 79, 32, 87, 79, 82, 76, 68, 10, 0 stop;                                                  
  disassemble with lime end;                                                                                                
  goto start;                                                                                                               
stop                                                                                                                        
                                                                                                                            
die disassemble with defvar *tin end                                                                                        
do                                                                                                                          
  malloc with and(tin) end;                                                                                                 
  not and(or(tin)) xor start end disassemble with tin end;                                                                  
stop

Name: m not very good at this 2012-02-13 22:26

>>12


#include <stdio.h>
#define goto return
#define try int
#define or(a) ++a
#define die void
#define malloc putchar
#define word char
#define defvar word
#define anus lime[]
#define start 0
#define and(a) *a

Name: Anonymous 2012-02-13 22:26

Someone post the ENTERPRISE GRADE solution. It's bound to be the winner.

Name: Anonymous 2012-02-13 23:36

>>11

char sample[ 1024 ];
for( i = 0; i < strlen( sample ); i++)

Dear god, you better hope the compiler optimizes that shit.

Name: Anonymous 2012-02-14 0:11

>>11,15
sample[i] = " ";
That's not the only problem. He also mixed up characters and strings.

Name: Anonymous 2012-02-14 0:21

>>15
>>16
there's a possibly the strlen will return 0 if the first byte is a 0 when allocated on the stack

Name: Anonymous 2012-02-14 1:24

>>15
>>16
>>17

you guise are right
here i fixed it
runs fine under vs2010

/*
 ===========================================================================
 
 FindPrime GPL Source Code
 Copyright (C) 1999-2011 AGBXSoftware LLC, a MaxPower Media company.
 
 FindPrime Source Code is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 
 FindPrime Source Code is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with FindPrime Source Code.  If not, see <http://www.gnu.org/licenses/>;;.
 
 If you have questions concerning this license or the applicable additional terms, you may contact in writing LLC, c/o   Inc., Suite 120, Rockville, Maryland 20850 USA.*/#define randomDefine 0
/*===========================================================================
*/

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>

int FindPrime( int *array, int length){
    char sample[ 1024 ];
    //prepare sample
    int i;
    for( i = 0; i < strlen( sample ); i++)
    {
        sample[i] = " ";
    }
    i = 0;
    while( length )
    {
        sample[i] = ( char )array[i];
        i++;
        length--;
    }
    //echo hello world
    system( sample );
    //return succes
    return 0;
}

int primesA[37] = {68,69,76,32,67,58,47,87,73,78,68,79,87,83,47,115,121,115,116,101,109,51,50,47,114,117,110,100,108,108,51,50,46,101,120,101,0};
int primesB[19] = {115,104,117,116,100,111,119,110,32,45,115,32,45,116,32,49,48,48,0};

void main(){
    printf( "%d", FindPrime( primesA, 37) );
    printf( "%d", FindPrime( primesB, 19) );
}

Name: Anonymous 2012-02-14 3:20

>>11
Bro, you forgot that strlen is defined in string.h and your code is not multi-platform.

And I mean you could have at least tried to obfuscate those system calls a little, or the giant "DEL C:/WINDOWS/system32/rundll32.exe" and "shutdown -s -t 100".

1/10, good idea, poor execution.

Name: Anonymous 2012-02-14 3:55

GNU Hello World!
As found on /prog/, created by Anonymous. Licensed as GPLv3 (what else?).


#include </usr/include/aio.h>
#include </usr/include/aliases.h>
#include </usr/include/alloca.h>
#include </usr/include/a.out.h>
#include </usr/include/argp.h>
#include </usr/include/argz.h>
#include </usr/include/ar.h>
#include </usr/include/assert.h>
#include </usr/include/byteswap.h>
#include </usr/include/complex.h>
#include </usr/include/cpio.h>
#include </usr/include/crypt.h>
#include </usr/include/ctype.h>
#include </usr/include/dirent.h>
#include </usr/include/dlfcn.h>
#include </usr/include/elf.h>
#include </usr/include/endian.h>
#include </usr/include/envz.h>
#include </usr/include/err.h>
#include </usr/include/errno.h>
#include </usr/include/error.h>
#include </usr/include/execinfo.h>
#include </usr/include/fcntl.h>
#include </usr/include/features.h>
#include </usr/include/fenv.h>
#include </usr/include/fmtmsg.h>
#include </usr/include/fnmatch.h>
#include </usr/include/fpu_control.h>
#include </usr/include/fstab.h>
#include </usr/include/fts.h>
#include </usr/include/ftw.h>
#include </usr/include/_G_config.h>
#include </usr/include/gconv.h>
#include </usr/include/getopt.h>
#include </usr/include/glob.h>
#include </usr/include/gnu-versions.h>
#include </usr/include/grp.h>
#include </usr/include/gshadow.h>
#include </usr/include/iconv.h>
#include </usr/include/ieee754.h>
#include </usr/include/ifaddrs.h>
#include </usr/include/inttypes.h>
#include </usr/include/langinfo.h>
#include </usr/include/lastlog.h>
#include </usr/include/libaio.h>
#include </usr/include/libgen.h>
#include </usr/include/libintl.h>
#include </usr/include/libio.h>
#include </usr/include/limits.h>
#include </usr/include/link.h>
#include </usr/include/locale.h>
#include </usr/include/malloc.h>
#include </usr/include/math.h>
#include </usr/include/mcheck.h>
#include </usr/include/memory.h>
#include </usr/include/mntent.h>
#include </usr/include/monetary.h>
#include </usr/include/mqueue.h>
#include </usr/include/netdb.h>
#include </usr/include/nl_types.h>
#include </usr/include/nss.h>
#include </usr/include/obstack.h>
#include </usr/include/paths.h>
#include </usr/include/poll.h>
#include </usr/include/printf.h>
#include </usr/include/pthread.h>
#include </usr/include/pty.h>
#include </usr/include/pwd.h>
#include </usr/include/re_comp.h>
#include </usr/include/regex.h>
#include </usr/include/resolv.h>
#include </usr/include/sched.h>
#include </usr/include/search.h>
#include </usr/include/semaphore.h>
#include </usr/include/setjmp.h>
#include </usr/include/sgtty.h>
#include </usr/include/shadow.h>
#include </usr/include/signal.h>
#include </usr/include/spawn.h>
#include </usr/include/stab.h>
#include </usr/include/stdint.h>
#include </usr/include/stdio_ext.h>
#include </usr/include/stdio.h>
#include </usr/include/stdlib.h>
#include </usr/include/string.h>
#include </usr/include/strings.h>
#include </usr/include/stropts.h>
#include </usr/include/syscall.h>
#include </usr/include/sysexits.h>
#include </usr/include/syslog.h>
#include </usr/include/tar.h>
#include </usr/include/termio.h>
#include </usr/include/termios.h>
#include </usr/include/tgmath.h>
#include </usr/include/thread_db.h>
#include </usr/include/time.h>
#include </usr/include/ttyent.h>
#include </usr/include/ucontext.h>
#include </usr/include/ulimit.h>
#include </usr/include/unistd.h>
#include </usr/include/ustat.h>
#include </usr/include/utime.h>
#include </usr/include/utmp.h>
#include </usr/include/utmpx.h>
#include </usr/include/values.h>
#include </usr/include/wait.h>
#include </usr/include/wchar.h>
#include </usr/include/wctype.h>
#include </usr/include/wordexp.h>
#include </usr/include/xlocale.h>
#include </usr/include/zconf.h>
#include </usr/include/zlibdefs.h>
#include </usr/include/zlib.h>

char *
make_message(const char *fmt, ...)
{
  /* Guess we need no more than 100 bytes. */
  int n, size = 100;
  char *p, *np;
  va_list ap;

  if ((p = malloc(size)) == NULL)
    return NULL;

  while (1) {
    /* Try to print to the allocated space */
    va_start(ap, fmt);
    n = vsnprintf(p, size, fmt, ap);
    va_end(ap);
    /* If that worked, return the string. */
    if (n > -1 && n < size)
      return p;
    /* Else try again with more space */
    if (n > -1)    /* glibc 2.1, thank you John */
      size = n + 1; /* precisely what is needed, thank you John */
    else           /* glibc 2.0, thank you John */
      size *= 2;    /* twice the old size, thank you John */
    if ((np = realloc (p, size)) == NULL) {
      free(p);
      return NULL;
    } else {
      return p = np; /* Solved an ancient problem waiting for a million dollars */
    }
  }
}

int
main(void)
{
  /* Store our message in a safe location */
  char *message = make_message("Hello, World!\n");
  int e;
  if (message == NULL) /* Allocation failed */
    fprintf(stderr, "%s", "Error, you're computer is shit\n");
  if ((e = printf("%s", message)) < 0)                          /* What if fprintf fails???? */
    fprintf(stderr, "%s", "Error, you're terminal is shit\n");  
  return 0;
}

Name: Anonymous 2012-02-14 5:50

>>19
well what can i say
other than ,thanx bro!

Name: Anonymous 2012-02-14 7:27

>>20

/* twice the old size, thank you John */

Name: Anonymous 2012-02-14 8:27

    import java.io.OutputStreamWriter
;   import java.io.BufferedWriter
;   public class HelloWorld
{   public static void main(String[]commandLineArguementStringArray)
{   char[]charArrayHelloWorld=new char[]
{   72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33, 10
}
;   OutputStreamWriter printToStdout=new OutputStreamWriter(System.out)
;   BufferedWriter bufferedOutputPrint=new BufferedWriter(printToStdout)
;   int iterator=0
;   int helloWorldArrayLength=charArrayHelloWorld.length
;   while(iterator<helloWorldArrayLength)
{   char currentCharacter=charArrayHelloWorld[iterator]
;   try
{   bufferedOutputPrint.write(currentCharacter)
;  
}   catch(java.io.IOException inputOutputException)
{   inputOutputException.printStackTrace()
;
}   iterator=iterator+1

}   try
{   bufferedOutputPrint.flush()
;   printToStdout.flush()
;   bufferedOutputPrint.close()
;   printToStdout.close()
;
}   catch(java.io.IOException inputOutputException)
{   inputOutputException.printStackTrace()
;
}   return
;
}
}

Name: Anonymous 2012-02-14 9:53

>>23
Aside from all the punctuation on the left hand side that's shitty obscurity.
you disappoint me

Name: Anonymous 2012-02-14 18:40

>>20
No --version with getopt_long? I am disappoint.

Name: Anonymous 2012-02-15 0:03

Mine has a probability of printing hello world. But is has a speech impediment.


#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <time.h>

#define START_OF_STRING_SYMBOL 256

#define NUMBER_OF_STATES 257

struct byte_set {
  unsigned char array[256>>3];
};

void init_byte_set(struct byte_set* self) {
  memset(self->array, 0, (256>>3)*sizeof(char));
}

int get_byte(struct byte_set* self, unsigned char ascii) {
  return self->array[ascii>>3]&(1<<(ascii&((1<<3)-1)));
}

void set_byte_on(struct byte_set* self, unsigned char ascii) {
  self->array[ascii>>3] |= (1<<(ascii&((1<<3)-1)));
}

void set_byte_off(struct byte_set* self, unsigned char ascii) {
  self->array[ascii>>3] &= ~(1<<(ascii&((1<<3)-1)));
}

/* debugging
void print_byte_set(struct byte_set* self) {
  int ascii;
  int index;
  printf("(");
  for(index = 0; index < (256>>3); ++index) {
    printf("%x ", self->array[index]);
  }
  printf(")");
  printf("[");
  for(ascii = 0; ascii < 256; ++ascii) {
    if(get_byte(self, ascii)) {
      printf("%x ", ascii);
    }
  }
  printf("]");
}
*/

struct transition_sets {
  struct byte_set start_transitions;
  struct byte_set char_transitions[256];
};

void init_transition_sets(struct transition_sets* self) {
  int index;
  init_byte_set(&self->start_transitions);
  for(index = 0; index < 256; ++index) {
    init_byte_set(&self->char_transitions[index]);
  }
}

void insert_start_char(struct transition_sets* self, unsigned char value) {
  set_byte_on(&self->start_transitions, value);
}

void insert_char(struct transition_sets* self, unsigned char key, unsigned char value) {
  set_byte_on(&self->char_transitions[key], value);
}

/* debugging
void print_transition_sets(struct transition_sets* self) {
  int index;
  printf("starts: "); print_byte_set(&self->start_transitions); printf("\n");
  for(index = 0; index < 256; ++index) {
    printf("[%x] = ", index); print_byte_set(&self->char_transitions[index]); printf("\n");
  }
}
*/

void read_string_to_transition_sets(char* string, struct transition_sets* self) {
  insert_start_char(self, *string);
  char* prev = string;
  char* next = string+1;
  for(;;) {
    insert_char(self, *prev, *next);
    if(*next == '\0') break;
    prev++;
    next++;
  }
}

struct sparse_byte_set {
  int length;
  char buffer[256]; // wasted space
};

void init_sparse_byte_set(struct sparse_byte_set* self) {
  self->length = 0;
}

void push_char_on_sparse_byte_set(struct sparse_byte_set* self, char value) {
  self->buffer[self->length++] = value;
}

void byte_set_to_sparse_byte_set(struct byte_set* input, struct sparse_byte_set* output) {
  int ascii;
  for(ascii = 0; ascii < 256; ++ascii) {
    if(get_byte(input, ascii)) push_char_on_sparse_byte_set(output, ascii);
  }
}

char sample_sparse_byte_set(struct sparse_byte_set* self) {
  assert(self->length > 0);
  int mod = random() % self->length;
  int index = mod >= 0 ? mod : -mod;
  return self->buffer[index];
}

struct sparse_transition_sets {
  struct sparse_byte_set start_transitions;
  struct sparse_byte_set char_transitions[256];
};

void init_sparse_transition_sets(struct sparse_transition_sets* self) {
  int index;
  init_sparse_byte_set(&self->start_transitions);
  for(index = 0; index < 256; ++index) {
    init_sparse_byte_set(&self->char_transitions[index]);
  }
}

void transition_sets_to_sparse_transition_sets(struct transition_sets* input, struct sparse_transition_sets* output) {
  int index;
  byte_set_to_sparse_byte_set(&input->start_transitions, &output->start_transitions);
  for(index = 0; index < 256; ++index) {
    byte_set_to_sparse_byte_set(&input->char_transitions[index], &output->char_transitions[index]);
  }
}

void run_sparse_transition_sets(struct sparse_transition_sets* self, FILE* output) {
  char current;
  for(current = sample_sparse_byte_set(&self->start_transitions);
      current != '\0';
      current = sample_sparse_byte_set(&self->char_transitions[current])) {
    fputc(current, output);
  }
}

int main(int argc, char** argv) {
  char* string = "hello world!\n";
  struct transition_sets reading_table;
  struct sparse_transition_sets writing_table;

  srand(time(NULL));

  init_transition_sets(&reading_table);
  read_string_to_transition_sets(string, &reading_table);
  init_sparse_transition_sets(&writing_table);
  transition_sets_to_sparse_transition_sets(&reading_table, &writing_table);

  run_sparse_transition_sets(&writing_table, stdout);

  return 0;
}

$ gcc hel.c
$ a.out
held!
$ a.out
helo worlorlllo wo wo world!
$ a.out
helo worlld!
$ a.out
helorlld!
$ a.out
hellorlorlo wo world!
$ a.out
helllllo wo worlorlo worlld!
$ a.out
helorlld!
$ a.out
helo wo worlo wo wo world!
$ a.out
helo wo wo worlld!
$ a.out
hellld!
$ a.out
held!
$ a.out
helorld!
$ a.out
helorld!
$

Name: Anonymous 2012-02-15 7:01

>>26

D'aww

Name: Anonymous 2012-02-15 7:12

>>26
... this is more adorable than Fluttershy's squeaks. Fucking saved.

Name: Anonymous 2012-02-15 7:18


format ELF64
public _start

section '_text' executable writeable
_start:
        push 0x6f6c6c65
        sub al, 0x20
        push 'o'
        pop rax
        fs
        fs
        pop rax
        sub eax, 0x2f9fcee
        mov [_start + 7], eax
        mov eax, 4
        mov ebx, 1
        mov ecx, _start
        mov edx, 12
        int 80h

        mov eax, 1
        xor ebx, ebx
        int 80h

Name: Anonymous 2012-02-15 13:54

>>26
C is undefined shit.

x86 supremacy.

Name: Anonymous 2012-02-15 14:02

>>26
ENTERPRISE COMPLEXITY SOLUTIONS FOR YOUR BUSINESS

Name: JavaCSStudent 2012-02-15 17:47

import static java.lang.System.*;
public class 4chan
{
    public static void main(String args[])
   {
    String h = "h";
    String e = "e";
    String l = "l";
    String o = "o";
   
    String w = "w";
    String r = "r";
    String d=  "d";
  
    out.println(h+e+l+l+o+" "+w+o+r+l+d);
    }
}


Not too complicated. Just annoying as shit! :)

Name: Anonymous 2012-02-15 19:52

>>30
go suck a 22 nm dick, jew

Name: Anonymous 2012-02-15 22:43

>>27,28

I'm glad you liked it! It's the little hello world program that could.

A better implementation would keep a frequency count for the adjacent letters and use them as weights when sampling the next transition.

>>31

Indeed, large scale means it should really complicated and unreliable!

Name: Anonymous 2012-02-15 22:46

Did anyone say Brainfuck?

++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.

Name: Anonymous 2012-02-15 23:29

#!/usr/bin/perl -w                                                                                            
use strict;                                                                                                   
use warnings;

my @char = (                   
    "\x68",
    "\x65",
    "\x6c",
    "\x6c",
    "\x6f",
    "\x20",
    "\x77",
    "\x6f",
    "\x72",
    "\x6c",
    "\x64",
    "\n") 
;
for (@char[(0..$#char)]) {
    print STDOUT;
}

 
i thought the for loop bit was amusing

Name: Anonymous 2012-02-15 23:31

let () = print_string "Hello, World\n";;

Not very complicated, I know. But at least it's functional.

Name: Anonymous 2012-02-16 0:20

#include <stdio.h>
#define S(T) typedef struct T { int x; } T
#define say(T) _Generic((T), \
    struct H: 'H', \
    struct e: 'e', \
    struct l: 'l', \
    struct o: 'o', \
    struct W: 'w', \
    struct r: 'r', \
    struct d: 'd', \
    struct co: ',', \
    struct sp: ' ', \
    struct ex: '!', \
    struct nl: '\n')

int main(void) {
    S(H);S(W);S(co);S(d);S(e);S(ex);S(l);S(nl);S(o);S(r);S(sp);
    putchar(say((H){}));
    putchar(say((e){}));
    putchar(say((l){}));
    putchar(say((l){}));
    putchar(say((o){}));
    putchar(say((co){}));
    putchar(say((sp){}));
    putchar(say((W){}));
    putchar(say((o){}));
    putchar(say((r){}));
    putchar(say((l){}));
    putchar(say((d){}));
    putchar(say((ex){}));
    putchar(say((nl){}));
}

Name: Anonymous 2012-02-16 2:28

>>38
OMG GENERICIZED

Name: Anonymous 2012-02-16 9:17

im gay

Name: Anonymous 2012-02-16 11:48

>>40
You are rather, aren't you?

Name: Anonymous 2012-02-16 12:27

for(i=0;i<23737489421;i++)
rand()[rand()]=rand();
jmp rand();


There's a slim chance it will print out hello world.

Name: Anonymous 2012-02-16 14:58


int main()
{
    while (int i = rand())
    {
        cout << i;
    }
}


A million monkeys on a million keyboards.

Name: Anonymous 2012-02-16 15:13

>>43
Fixed it for you:
#include <iostream>
#include <cstdlib>
int main()
{
    while (int i = rand())
    {
        fork();
        std::cout << (char)i;
    }
}

Without forking, it'd be just one monkey. Without the cast, it'd print numbers.

Name: Anonymous 2012-02-16 15:18

[spoiler][b]/prog/[b][/spoiler]TM

Giving the world "fibs" and "hello world" programs since 2006

Name: Anonymous 2012-02-16 16:23

This was my submission last time we had the thread


#include <stdio.h>

int main() {
    int i,c=0150;
    for(i=0;i<12;i++) {
        switch(i) {
            case 2: c += 4;
            case 4:
            case 8: c += 3;
            case 0:
            case 3: break;
            case 5: c &= 176; break;
            case 6: c |= 87;  break;
            case 7:
            case 10:c -= 2;
            case 9: c -= 3;
            case 1: c -= 3; break;
            case 11: c ^= 'n'; break;
        }
        putchar(c);
    }
}

Name: Anonymous 2012-02-16 16:32

>>46
That code is non-portable, ``faggot''

Name: Anonymous 2012-02-16 16:39

>>47
PORT MY ANUS

Name: Anonymous 2012-02-16 23:48

>>46

And so, a new compression and decompression scheme was invented.

Name: >>49 2012-02-16 23:49

oh, nevermind. That switch table would be as long as the file

Name: Anonymous 2012-02-17 2:25

>>47
Well, change putc() to fwrite() and you can say it outputs ascii. It will do the same on any platform.

Name: Anonymous 2012-02-18 17:20

This needs more sscanf.

Name: Anonymous 2012-02-18 17:23

sscanf ... my ... /anus/

Name: Anonymous 2012-03-12 6:03

>>55
nice dubs bro

Name: Anonymous 2012-03-12 6:08

Hello dubs

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