Five Quines

Andy Balaam
artificialworlds.net/blog

One

const unsigned char data[] = { /* snip */ };
#include <stdio.h>
int main() {
  printf( "const unsigned char data[] = {" );
  for ( int i=0; i<sizeof(data); i++ ) {
    printf( " %0#4x,", data[i] );
  }
  printf( "\n};\n\n" );
  for ( int j=0; j<sizeof(data); j++ )
    putchar( data[j] );
  return 0;
}

One

Two

10 LIST

Two

Three

int main(void){
  char str[]= " int main(void)\
{ char str[]= %c%s%c;\
printf(str, 0x22, str, 0x22);}";
  printf(str, 0x22, str, 0x22);}

Three

Four


Four

Five

(define x '(
  (display "(define x '(")
  (newline)
  (map (lambda (s) (write s) (newline)) x)
  (display "))")
  (newline)
  (display "(map eval x)")
  (newline)
  ))
(map eval x)

Five

More info

Videos youtube.com/user/ajbalaam
Twitter @andybalaam
Blog artificialworlds.net/blog
Projects artificialworlds.net