text:
Generating PBM bitmap files from ASCII text
The PBM (Portable BitMap) format is a very simple ASCII black and white bitmap format.
Here's an example for the letter 'J' (copy-pasted from the wikipedia link):

P1
# This is an example bitmap of the letter "J"
6 10
0 0 0 0 1 0
0 0 0 0 1 0
0 0 0 0 1 0
0 0 0 0 1 0
0 0 0 0 1 0
0 0 0 0 1 0
1 0 0 0 1 0
0 1 1 1 0 0
0 0 0 0 0 0
0 0 0 0 0 0

It's time we build a small tool to generate files in this nifty little format!
Your goal is to write the shortest program (in any language) that conforms to the following rules:

Your program takes one string from stdin (for example CODEGOLF.STACKEXCHANGE.COM!)
It generates a PBM file with a bitmapped (readable) representation of the string.
Each character is constructed as a 8x8 grid.
You must support the characters [A-Z] (all uppercase), space, a point ('.') and an exclamation mark ('!').
No external libraries allowed (certainly no PBM related ones)!
The used character set must not simply be external to your program. Part of the challenge is storing the characters efficiently...

Testing for validness of the PBM format can be done with the GIMP (or others). Do show off sample input and output!
The shortest solution will be awarded the answer points on 2012-01-31.
Have fun golfing!
PS: I've added a bounty (percentage-wise a huge part of my codegolf reputation) to (hopefully) draw in more competitors.

By "its bitmapped representation" do you mean a character representation which is close to something which looks like letters? How close? Would something like a bitmap representation of a binary code or of braille or morse code be allowed?

@Howard: the idea is to generate a pbm image which contains the original input text in 'rendered' (bitmapped) but still human-readable form (with letters in other words). Not unlike the example linked to.

I added the tag [tag:kolmogorov-complexity] because the bulk of the program is going to be the 30 bitmaps.

@Peter Taylor: Good point, thanks!

I feel we're going to have long and painful debate on what constitutes an "external library."

I think you should have provided a font (or fonts) and required it's use (or penalized for deviating), since the simplest way to win is to use the smallest, most barely legible font possible.

I don't think this is technically kolmogorov complexity since the output isn't constant.

I agree with @12Me21 (and @ Sir_Lagsalot 's comment reinforces this). anyway I think this way the challenge is stated is fine, it's nice that the font design is involved in the solution.

GolfScript, 133 bytes
This is based on my 164-byte Perl solution and uses the same nibble-packed 4 by 5 pixel font.  Again, I'll give the readable version first:
{91,65>"!. "+?}%:s"P4"\,8*8'FONT DATA HERE'{16base}%[3]/{:p;{[p=0]0=}s%}%]n*

Here, FONT DATA HERE stands for 71 bytes of binary packed font data.  The encoding is slightly different than in the Perl version: instead of splitting the packed string on whitespace, I expand it first and then split it on the nibble 3 (chosen because it just happens not to occur anywhere in the font).
Since the font data in the actual script contains unprintable characters, I give it as a hex dump below.  Use xxd -r to turn the hex dump back into executable GolfScript code:
0000000: 7b39 312c 3635 3e22 212e 2022 2b3f 7d25  {91,65>"!. "+?}%
0000010: 3a73 2250 3422 5c2c 382a 3827 36e6 eff6  :s"P4"\,8*8'6...
0000020: 9219 8996 e6e7 7959 95f4 3999 9888 921a  ......yY..9.....
0000030: 8fd9 9998 2959 9514 3fe8 9eeb f21c 89b9  ....)Y..?.......
0000040: e9e6 2959 6564 3999 9889 929a 8999 8ba1  ..)Yed9.........
0000050: 295f 9283 9e6e f869 269f 9968 79e2 6299  )_...n.i&..hy.b.
0000060: 2f48 3327 7b31 3662 6173 657d 255b 335d  /H3'{16base}%[3]
0000070: 2f7b 3a70 3b7b 5b70 3d30 5d30 3d7d 7325  /{:p;{[p=0]0=}s%
0000080: 7d25 5d6e 2a                             }%]n*

Unlike the Perl script, this code prints any characters outside the set A–Z, !, ., space as funny-looking little squiggles.  Replacing the squiggles with blanks would cost 2 extra chars; removing them entirely would cost 4.
This is my first GolfScript program ever, so I wouldn't be surprised if there's some room left for optimization.  Here's how it works:

{91,65>"!. "+?}%:s maps the valid input characters (A–Z, !, ., space) to the numbers 0 – 28 and assigns the result to s.  Any characters outside the valid set get mapped to -1, which is what produces the squiggles when printed.
"P4"\,8*8 pushes the values "P4", 8 times the length of the input, and 8 onto the stack.  When printed at the end, these will form the PBM header.
{16base}%[3]/ takes the preceding string of font data, splits each byte of it into two nibbles, and splits the result into blocks delimited by the value 3.  {:p;{[p=0]0=}s%}% then loops over these blocks, first assigning each block to the variable p and then looping over the remapped input string s, replacing each character with the value at the corresponding offset in p.  The funny-looking construct [p=0]0= does the same as p=, except that it returns 0 for any offsets past the end of p; I don't really like it, but I haven't been able to figure out any shorter way to handle that.
Finally, ]n* takes everything on the stack (the three header values and the image data array) and joins them together with newlines for printing.

Seriously short (by any metric). Nice!

Perl, 164 bytes, no zlib/gzip compression
After sleeping on the problem, I managed to figure out a much shorter solution than my first one.  The trick is to take advantage of a minor loophole in the rules: the characters need to fit in 8 by 8 pixels each, but nothing says they have to fill all that space.  So I drew my own 4 by 5 pixel font, allowing me to pack two characters into 5 bytes.
The output looks like this:
 (scaled x 4)
     (original size)
Before giving the actual code with the embedded font data, let me show a de-golfed version:
y/A-Z!./\0-\033/ for @a = <> =~ /./g;
say "P4 " . 8*@a . " 8";
for $p (qw'PACKED FONT DATA') {
    print chr vec $p, ord, 4 for @a;
}

In the actual code, the PACKED FONT DATA is replaced by a binary string consisting of eight whitespace-delimited rows (four 14-byte rows and one 13-byte one, plus three single null bytes for the blank rows).  I deliberately designed my font so that the packed data contains no whitespace, single quotes or backslashes, so that it could be encoded in qw'...'.
Since the packed font string contains unprintable characters, I've provided the actual script as a hex dump.  Use xxd -r to turn it back into executable Perl code:
0000000: 792f 412d 5a21 2e2f 002d 1b2f 666f 7240  y/A-Z!./.-./for@
0000010: 613d 3c3e 3d7e 2f2e 2f67 3b73 6179 2250  a=<>=~/./g;say"P
0000020: 3420 222e 382a 4061 2e22 2038 223b 666f  4 ".8*@a." 8";fo
0000030: 7224 7028 7177 2700 20e6 e6ff 9612 8999  r$p(qw'. .......
0000040: e6e6 7759 99f5 0420 9999 8898 128a df99  ..wY... ........
0000050: 9928 5999 1504 20ef 98ee fb12 8cb9 e9e9  .(Y... .........
0000060: 2659 6965 0420 9999 8899 928a 9989 ab21  &Yie. .........!
0000070: 599f 8220 e9e6 8f96 62f9 9986 972e 2699  Y.. ....b.....&.
0000080: f284 2000 2000 2729 7b70 7269 6e74 2063  .. . .'){print c
0000090: 6872 2076 6563 2470 2c6f 7264 2c34 666f  hr vec$p,ord,4fo
00000a0: 7240 617d                                r@a}

Here's how it works:

The first line (in the de-golfed version) reads a single line of input, splits it into an array of characters (conveniently omitting any trailing newlines) and maps the letters A to Z and the characters ! and . to the character codes 0 to 28, which normally correspond to unprintable control characters in ASCII / Unicode.  (A minor side effect of this is that any tabs in the input get printed as Js.)  The space character is left unmapped, since the output loop turns any codes above 28 into blanks anyway.
The second line just prints the PBM header.  It uses the Perl 5.10 say feature, so you need to run this script with perl -M5.010 for it to work.
The output loop takes a whitespace-delimited list of packed image rows and assigns each of them into $p in turn.  (I designed the font so that the packed data wouldn't contain any whitespace or ' characters.)  It then loops over the input characters in @a, using Perl's vec command to extract the 4-bit nibble corresponding to the mapped character code from the image row, pads it to an 8-bit byte and prints it.

Old answer, 268 bytes:
This is a quick and dirty first attempt.  I stole PleaseStand's font and compressed it along with my source code.  Since the resulting script is mostly unprintable, here's a hexdump; use xxd -r to turn it into executable Perl code:
0000000: 7573 6520 436f 6d70 7265 7373 275a 6c69  use Compress'Zli
0000010: 623b 6576 616c 2075 6e63 6f6d 7072 6573  b;eval uncompres
0000020: 7320 2778 da85 d03d 4b03 4118 85d1 452c  s 'x...=K.A...E,
0000030: b69c 72cb 7519 4894 552c 2c02 3319 ee5c  ..r.u.H.U,,.3..\
0000040: d7b8 5a89 6093 4634 7e82 c490 6c91 8597  ..Z.`.F4~...l...
0000050: 80fe 7267 d660 23ae e52d 0e0f dcd6 f8c3  ..rg.`#..-......
0000060: e9d1 5e6e ccec a15c ddb5 c5d5 495e 94a3  ..^n...\....I^..
0000070: 83b7 c7f9 73f3 5216 f9a8 787a 5fea 666c  ....s.R...xz_.fl
0000080: 9dd1 b763 dd98 76f8 2df6 0799 5811 7144  ...c..v.-...X.qD
0000090: 4acc ee9d b8b0 c90f 7e4a 8264 6016 cbd7  J.......~J.d`...
00000a0: 79f3 1b91 047c 4055 409e 9e54 1dda ed41  y....|@U@..T...A
00000b0: 9a20 8080 6adc 5c47 8488 7495 f621 01d7  . ..j.\G..t..!..
00000c0: 6b6c 902e b6c8 2a6a 6643 f56f e99c 115d  kl....*jfC.o...]
00000d0: 5c7a f1b2 13d0 3453 790f da74 c813 751d  \z....4Sy..t..u.
00000e0: 11ce d821 ad90 247f 2292 5b54 c14f 3c4e  ...!..$.".[T.O<N
00000f0: 49c5 4c53 a1a7 c478 391c 714c f113 0747  I.LS...x9.qL...G
0000100: ab6c 4482 9fd2 177a 5677 6327            .lD....zVwc'

The decompressed Perl code consists of the following preamble:
y;A-Z.! ;;cd,say"P4 ",8*length," 8"for$t=<>

followed by eight repetitions of the following code:
;$_=$t;y(A-Z.! )'BITMAP DATA HERE';print

with BITMAP DATA HERE replaced with 29 bytes encoding one row of the font.

The newer solution is extremely nice. Never imagined this could be done in 165 chars.

I'm having a lot of trouble reversing the original with xxd -r. Curious if anyone had success / tips for doing so?

@Beefy_Swain: What's going wrong? Just copy-pasting the hex dump from the answer into a file (e.g. prog.hex) and running xxd -r < prog.hex > prog.pl should work.

Shell script (code+data = 295 chars)
I hope tail, gzip, and dd do not count as "external libraries." Run as echo -n 'YOUR TEXT HERE' | ./text.sh > out.pbm. The font I used is Small Fonts size 7.5, although I did  have to clip the descender off the Q.
Example output

Code (137 chars)
i=`od -tu1|cut -c9-`
echo P4
for a in {0..7}
do for b in $i
do tail -2 $0|zcat|dd bs=1 count=1 skip=$((8*b+a))
done
done>8
wc -c 8
cat 8

Complete script
(use xxd -r to recreate original file)
0000000: 693d 606f 6420 2d74 7531 7c63 7574 202d  i=`od -tu1|cut -
0000010: 6339 2d60 0a65 6368 6f20 5034 0a66 6f72  c9-`.echo P4.for
0000020: 2061 2069 6e20 7b30 2e2e 377d 0a64 6f20   a in {0..7}.do
0000030: 666f 7220 6220 696e 2024 690a 646f 2074  for b in $i.do t
0000040: 6169 6c20 2d32 2024 307c 7a63 6174 7c64  ail -2 $0|zcat|d
0000050: 6420 6273 3d31 2063 6f75 6e74 3d31 2073  d bs=1 count=1 s
0000060: 6b69 703d 2428 2838 2a62 2b61 2929 0a64  kip=$((8*b+a)).d
0000070: 6f6e 650a 646f 6e65 3e38 0a77 6320 2d63  one.done>8.wc -c
0000080: 2038 0a63 6174 2038 0a1f 8b08 0000 0000   8.cat 8........
0000090: 0000 ffed cdb1 0a83 3014 8561 910e 8e8e  ........0..a....
00000a0: 193b dca1 631f 2084 9353 6ba3 a3e0 e2a8  .;..c. ..Sk.....
00000b0: 2fe0 d8e1 22d8 276f 9a50 e813 940e fdb8  /...".'o.P......
00000c0: 70f9 a753 247f 7829 f0b5 b9e2 c718 2322  p..S$.x)......#"
00000d0: 1ba9 e9a8 9688 6895 892a 7007 f0fe 701e  ......h..*p...p.
00000e0: b879 ef48 6e8c aa4f 219c d984 750d 0d91  .y.Hn..O!...u...
00000f0: e9b2 8c63 d779 3fcf c3d0 f76d eb7c e2d2  ...c.y?....m.|..
0000100: 1880 d4d7 4b6e 9296 b065 49ab 75c6 cc92  ....Kn...eI.u...
0000110: 1411 63f6 7de7 3489 9031 847c 3c9a 531d  ..c.}.4..1.|<.S.
0000120: e9a1 aa8f 803e 01                        .....>.

Explanation

od is the standard "octal dump" utility program. The -tu1 option tells it to produce a decimal dump of individual bytes instead (a sufficient workaround for bash's lack of asc(), ord(), .charCodeAt(), etc.)
P4 is the magic number for a binary format PBM file, which packs eight pixels into each byte (versus P1 for the ASCII format PBM file). You will see how this proves useful.
Per row of final output, the program pulls an eight-pixel byte (corresponding to the ASCII code and line number) from the gzip-compressed data section at the end using dd. (tail -2 $0 extracts the script's last two lines; the compressed data includes one 0x0a linefeed byte.) It so happens that eight pixels is the width of a single character. The null bytes that fill the gaps between supported characters are easily compressible because they are all the same.
All this is written to a file named "8". Because there are exactly eight rows (and also eight pixels per byte), the number of bytes is the width of the output in pixels. The output's height is also included in that wc -c prints the input filename "8" after its byte count.
Now that the header is complete, the image data is printed. Bash only notices that the last two lines are not valid commands (the last one actually invalid UTF-8) after it has executed everything coming before.
I used KZIP only to compress the data section, as Ilmari Karonen did for an entire submission to the 12 Days of Christmas challenge. As described there, it is essentially necessary to use a hex editor to replace the ZIP header format with a gzip header. Including the CRC-32 and file size from the original ZIP header seems to be unnecessary.

Really nice (and short) solution! In shell scripting the usage of dd, tail and gzip shouldn't be regarded as external imho.

Mind adding an explanation of how this works?  Would be much appreciated.

Very nice, thanks a lot for the explanation.
However using the 'P4' version is a not really respecting what the OP said "a very simple ASCII black and white bitmap format".

8086 Machine Code
190 Bytes (122 Bytes using BIOS)
Here's Base64 encoded WinXP/MSDos .COM file:
M8COwCaKDoUEitEmxD4MAaCAAP7IfliK8MHgA7cK9ve9egEAZ
vy0APb3AUb6iMi0APb3AUb+x0YACg2DxQK+ggCK7qz24YvYJo
ohswjQ5LAwFACIRgBF/st18v7NdeRH/sp10sZGACS6cAG0Cc0
hw1AxCg0wMDAgMDA=

(Use something like this) to decode the text and save as "pbm.com". Then, at the command prompt, type:

pbm text to encode>outputfilename.pbm

I've tested this on my WinXP machine using both the standard command prompt and DosBox V0.74.
UPDATE
This version is 190 bytes and uses Ilmari Karonen's tiny font (no bios access here!):-
voAArf7Iflq7YwG/vgG6Cg20Bfbk9vIAZfsy5PbyAUX5Vqw48HQoLEFzCDQG/sAMGSQfM8
nQ6NfA0QPS6IjEsQSwJtDsENCq4vewMKrr04DDEF6A+7N1ycYFJLqzAbQJzSHDdnb/loIZ
mXZ2flmZ9QAAIJmZEZGCFb+ZmSFZmYUPDy9/kXf9ghPZeXkmWWllAAAgmZkRmZIVmRldKF
mfEgAAAHl2H5Zi+ZkWnicmmfIAICBQMQoNMDAwIDUKDQ==

Extremly nice solution. At the moment this is the contender for the bounty which shall be awarded in about 20 hours. Well done!

Can you post your assembly code for this as well?

After looking at the dissassembly and testing the code, it appears you are just using a bitmap font provided by the bios. This can be confirmed by the fact that your program can output lowercase letters, symbols, and punctuation not required by the challenge. Thus, the font is external to your program and not stored by it (at least in my opinion).

@Skizz: can you confirm this? It still makes for an extremly nice solution but it a little bit against the spec.

@ChristopheD: Well, J B did comment "I feel we're going to have long and painful debate on what constitutes an external library." - one could argue that puts in Ruby is an external library. Yes, it does use the bios fonts, accessed through a pointer derefence (there is no load operation to get the fonts into RAM). Bending the rules too far perhaps. I'd have gotten away with it if it hadn't have been for those pesky kids ;-)

Very nice, you have my +1.  @ChristopheD: Rules clarification, please: is it OK for the output image height to be less than 8?  Because if so, I can shave a bunch of chars off my solutions.

Python 2, 248 247 bytes
s=raw_input();k=len(s);print"P1",k*8,8
for i in range(k*24):a=s[i/3%k];j=max(".!".find(a)+1,ord(a)-62)*3;print int("00080084IMVAENBSIFERBSUF4UFQQEMVDT4NAP4MNDSI9MRTMRBARA4NBQRAMNBE4E94NURDARDNRDMLD95DSL7"[j:j+3],32)>>(i/3/k*3+i%3)&1," 0"*(i%3/2*5)

Uses a 3x5 font, packed into a printable string, 3 bytes per character.  The font is clearly legible, although the n is lowercase and the v might be mistaken for a u if it isn't seen in context.
Actual Size:

Zoomed x3:

The output is a P1 type PBM, as per the example in the challenge.  It was a fun challenge.

Ruby 1.9, 346 bytes (122 code + 224 bytes data)
Here is the result:

(It's nice, isn't it?)
z=0..7;puts"P1\n#{(s=gets).size*8} 8",z.map{|i|s.bytes.flat_map{|o|z.map{|j|'DATA'.unpack('Q<*')[o>64?o-63:o/46][i*8+j]}}*' '}

The font was generated by figlet -f banner -w 1000 $LETTERS and this script.
Run with echo -n 'CODEGOLF.STACKEXCHANGE.COM!' | ruby script.rb > image.pbm.
The script generate all the rows and simply print them.
Here is an hexdump (use xxd -r):
0000000: 7a3d 302e 2e37 3b70 7574 7322 5031 5c6e  z=0..7;puts"P1\n
0000010: 237b 2873 3d67 6574 7329 2e73 697a 652a  #{(s=gets).size*
0000020: 387d 2038 222c 7a2e 6d61 707b 7c69 7c73  8} 8",z.map{|i|s
0000030: 2e62 7974 6573 2e66 6c61 745f 6d61 707b  .bytes.flat_map{
0000040: 7c6f 7c7a 2e6d 6170 7b7c 6a7c 271c 1c1c  |o|z.map{|j|'...
0000050: 0800 1c1c 0000 0000 001c 1c1c 0008 1422  ..............."
0000060: 417f 4141 003f 4141 3f41 413f 003e 4101  A.AA.?AA?AA?.>A.
0000070: 0101 413e 003f 4141 4141 413f 007f 0101  ..A>.?AAAAA?....
0000080: 1f01 017f 007f 0101 1f01 0101 003e 4101  .............>A.
0000090: 7941 413e 0041 4141 7f41 4141 001c 0808  yAA>.AAA.AAA....
00000a0: 0808 081c 0040 4040 4041 413e 0042 2212  .....@@@@AA>.B".
00000b0: 0e12 2242 0001 0101 0101 017f 0041 6355  .."B.........AcU
00000c0: 4941 4141 0041 4345 4951 6141 007f 4141  IAAA.ACEIQaA..AA
00000d0: 4141 417f 003f 4141 3f01 0101 003e 4141  AAA..?AA?....>AA
00000e0: 4151 215e 003f 4141 3f11 2141 003e 4101  AQ!^.?AA?.!A.>A.
00000f0: 3e40 413e 007f 0808 0808 0808 0041 4141  >@A>.........AAA
0000100: 4141 413e 0041 4141 4122 1408 0041 4949  AAA>.AAAA"...AII
0000110: 4949 4936 0041 2214 0814 2241 0041 2214  III6.A"..."A.A".
0000120: 0808 0808 007f 2010 0804 027f 0027 2e75  ...... ......'.u
0000130: 6e70 6163 6b28 2751 3c2a 2729 5b6f 3e36  npack('Q<*')[o>6
0000140: 343f 6f2d 3633 3a6f 2f34 365d 5b69 2a38  4?o-63:o/46][i*8
0000150: 2b6a 5d7d 7d2a 2720 277d                 +j]}}*' '}

It takes 93 bytes of code when using goruby:
ps"P1\n#{(s=gt).sz*8} 8",8.mp{|i|s.y.fl{|o|8.mp{|j|'DATA'.ua('Q<*')[o>64?o-63:o/46][i*8+j]}}*' '}

Using ZLib trim the data size to 142 bytes instead of 224, but adds 43 bytes in the code, so 307 bytes:
#coding:binary
require'zlib';z=0..7;puts"P1\n#{(s=gets).size*8} 8",z.map{|i|s.bytes.flat_map{|o|z.map{|j|Zlib.inflate("DATA").unpack('Q<*')[o>64?o-63:o/46][i*8+j]}}*' '}

Which gives a total of 268 when using goruby:
#coding:binary
rq'zlib';ps"P1\n#{(s=gt).sz*8} 8",8.mp{|i|s.y.fl{|o|8.mp{|j|Zlib.if("DATA").ua('Q<*')[o>64?o-63:o/46][i*8+j]}}*' '}

Java 862 826:
Here is a different approach. I think 'awt' does not count as external lib.
import java.awt.*;
class B extends Frame{String s="ABCDEFGHIJKLMNOPQRSTUVWXYZ .!";int l=29;static Robot r;int[][][]m=new int[l][8][8];
public void paint(Graphics g){for(int y=0;y<8;++y){int py=(y<3)?y:y+1;for(int a=0;a<l;++a)
for(int x=0;x<8;++x)
m[a][x][y]=(r.getPixelColor(8*a+x+17+x/4,py+81)).getRGB()<-1?1:0;}
System.out.println("P1\n"+(getTitle().length()*8)+" 8");
for(int y=0;y<8;++y){for(char c:getTitle().toCharArray()){int a=s.indexOf(c);
for(int x=0;x<8;++x)System.out.print(m[a][x][y]);}
System.out.println();}
System.exit(0);}
public B(String p){super(p);
setBackground(Color.WHITE);
setSize(400,60);
Label l=new Label(s);
l.setFont(new Font("Monospaced",Font.PLAIN,13));
add(l);
setLocation(9,49);
setVisible(true);}
public static void main(String a[])throws Exception{r=new Robot();
new B(a[0]);}}

And ungolfed:
import java.awt.*;

class PBM extends Frame
{
    String s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ .!";
    int l=29;
    Robot robot;
    int[][][] map = new int[l][8][8];

    static boolean init = false;

    public void paint (Graphics g)
    {
        for (int y = 0; y < 8; ++y)
        {
            int py = (y < 3) ? y : y +1;
            for (int a = 0; a < l; ++a)
            {
                for (int x = 0; x < 8; ++x)
                {
                    map[a][x][y] = (robot.getPixelColor (8*a+x+17+x/4, py+81)).getRGB () < -1 ? 1 : 0;
                }
            }
        }

        System.out.println("P1\n"+(getTitle().length()*8)+" 8");

        for (int y = 0; y < 8; ++y) {
            for (char c : getTitle ().toCharArray ()) {
                int a = s.indexOf (c);
                for (int x = 0; x < 8; ++x) {
                    System.out.print (map[a][x][y]);
                }
            }
            System.out.println ();
        }
        System.exit (0);
    }

    public PBM (String p) throws Exception
    {
        super (p);
        robot = new Robot ();
        setBackground (Color.WHITE);
        setSize (400, 60);
        Label l=new Label(s);
        l.setFont (new Font ("Monospaced", Font.PLAIN, 13));
        add(l);
        setLocation (9,49);
        setVisible (true);
    }

    public static void main (String args[]) throws Exception
    {
        new PBM (args[0]);
    }
}

Robot is the somehow curious way of Java to call getPixel. I create a Label with the alphabet, and measure where a pixel is for each letter.
In the paint method, int py = (y < 3) ? y : y +1; and (8*a+x+17+x/4, py+81) is the complicated way, to adjust the position in the font. Huuuh! else it would need 9 lines, and every 4th letter, there is an additional pixel horizontally. Trial and error brought me to this solution.
Then the header of the PBM is written, and each line of the message. The message is passed as title of the frame.
That's it. Not the shortest code, but no manual font painting was necessary.
Maybe it could be shorter in BeanShell or Scala.
And now - how does it look like?
java B "JAVA.CAFE BABE" > jcb.pbm

Multiple zooms applied:
Unzoomed:
Not that the number of chars is the number of chars from the Perl solution shuffled.
(golfed a little bit more. Made Robot static, which avoids one Exception declaration.)

Original approach, nicely done!

+1 for originality, but eww... if you're going to scale up a bitmap, use nearest neighbor interpolation.

I used eog (Eye of Gnome) and a screenshot. I'll upload an unscaled jpg-version; maybe your browser uses a nearest neighbor interpolation :) .

C++ TOO LARGE TO WIN
I wrote a full featured PPM drawing program in C++, with my own bitmapped font. Even stripping out all non necessary functions it's still huge compared to the answers here because of the definition for the font.
Anyway, here is the output for HELLO WORLD:

And the code:
ppmdraw.h
#ifndef PPMDRAW_H
#define PPMDRAW_H

#include <fstream>
#include <sstream>
#include <map>
#include <bitset>
#include <vector>

struct pixel{
    unsigned char r;
    unsigned char g;
    unsigned char b;

    bool equals(pixel p){
        return (r == p.r && g == p.g && b == p.b);
    }
};

class PPMDraw
{
    public:
        PPMDraw(int w, int h);

        virtual ~PPMDraw();

        void fill(unsigned char r, unsigned char g, unsigned char b);

        void set_color(unsigned char r, unsigned char g, unsigned char b);

        void draw_point(int x, int y);

        void draw_char(int x, int y, char c);
        void draw_string(int x, int y, std::string text);

        bool save(std::string file);

    private:

        int width;
        int height;

        pixel * image;

        std::vector<bool> checked;

        unsigned char red;
        unsigned char green;
        unsigned char blue;

        void init_alpha();
        std::map<char, std::bitset<48> > font;

};

#endif // PPMDRAW_H

ppmdraw.cpp
#include "PPMDraw.h"
#include <fstream>
#include <iostream>
#include <sstream>
#include <cstdlib>
#include <cmath>
#include <map>
#include <bitset>
#include <vector>

// standard constructor
PPMDraw::PPMDraw(int w, int h){
    width = w;
    height = h;

    // make an array to hold all the pixels, r, g, b for each
    image = new pixel[width * height];

    // a bitset to use for functions that have to check which pixels have been worked on
    checked = std::vector<bool>();
    for(int i = 0; i < width * height; i++){
        checked.push_back(false);
    }

    init_alpha();
}

PPMDraw::~PPMDraw(){
    if(image != nullptr){
        delete[] image;
    }
}

void PPMDraw::fill(unsigned char r, unsigned char g, unsigned char b){
    for(int i = 0; i < width * height; i++){
        image[i + 0] = pixel{r, g, b};
    }
}

void PPMDraw::set_color(unsigned char r, unsigned char g, unsigned char b){
    red = r;
    green = g;
    blue = b;
}

void PPMDraw::draw_point(int x, int y){
    if(x >= 0 && x < width && y >= 0 && y < height){
        image[y * width + x] = pixel{red, green, blue};
    }
}

void PPMDraw::draw_char(int x, int y, char c){
    std::bitset<48> letter = font[c];
    int n = 47;
    for(int i = 0; i < 6; i++){
        for(int j = 0; j < 8; j++){
            if(letter[n]){
                draw_point(x + i, y + j);
            }
            n--;
        }
    }
}
void PPMDraw::draw_string(int x, int y, std::string text){
        for(unsigned int i = 0; i < text.length(); i++){
            draw_char(x + 6 * i, y, text[i]);
        }

}

bool PPMDraw::save(std::string file){
    std::ofstream save(file.c_str(), std::ios_base::out | std::ios_base::binary);
    if(save.is_open()){
        save << "P6" << std::endl;
        save << width << " " << height << std::endl;
        save << "255" << std::endl;
        unsigned char * temp = new unsigned char[height * width * 3];
        for(int i  = 0; i < height * width; i++){
            temp[i * 3 + 0] = image[i].r;
            temp[i * 3 + 1] = image[i].g;
            temp[i * 3 + 2] = image[i].b;
        }
        save.write(reinterpret_cast<const char *> (temp), height*width*3*sizeof(unsigned char));
        delete temp;
        save.close();
        return true;
    }else{
        return false;
    }

}

void PPMDraw::init_alpha(){
    // Define a simple font for drawing text
    font[' '] = std::bitset<48>  (std::string("000000000000000000000000000000000000000000000000"));
    font['!'] = std::bitset<48>  (std::string("000000000000000011110110000000000000000000000000"));
    font['"'] = std::bitset<48>  (std::string("000000001100000000000000110000000000000000000000"));
    font['#'] = std::bitset<48>  (std::string("001010001111111000101000111111100010100000000000"));
    font['$'] = std::bitset<48>  (std::string("001001000101010011111110010101000100100000000000"));
    font['%'] = std::bitset<48>  (std::string("000000100100110000010000011000001000010000000000"));
    font['&'] = std::bitset<48>  (std::string("000111001110001010110010110011000000001000000000"));
    font['\\'] = std::bitset<48>  (std::string("100000000110000000010000000011000000001000000000"));
    font['('] = std::bitset<48>  (std::string("000000000000000001111100100000100000000000000000"));
    font[')'] = std::bitset<48>  (std::string("000000001000001001111100000000000000000000000000"));
    font['*'] = std::bitset<48>  (std::string("010010000011000011100000001100000100100000000000"));
    font['+'] = std::bitset<48>  (std::string("000100000001000001111100000100000001000000000000"));
    font[','] = std::bitset<48>  (std::string("000000000000000000000110000000000000000000000000"));
    font['-'] = std::bitset<48>  (std::string("000100000001000000010000000100000001000000000000"));
    font['.'] = std::bitset<48>  (std::string("000000000000000000000100000000000000000000000000"));
    font['/'] = std::bitset<48>  (std::string("000000100000110000010000011000001000000000000000"));
    font['0'] = std::bitset<48>  (std::string("011111001000001010000010100000100111110000000000"));
    font['1'] = std::bitset<48>  (std::string("000000001000001011111110000000100000000000000000"));
    font['2'] = std::bitset<48>  (std::string("010011101001001010010010100100100111001000000000"));
    font['3'] = std::bitset<48>  (std::string("010001001000001010000010100100100110110000000000"));
    font['4'] = std::bitset<48>  (std::string("111100000001000000010000000100001111111000000000"));
    font['5'] = std::bitset<48>  (std::string("111001001001001010010010100100101001110000000000"));
    font['6'] = std::bitset<48>  (std::string("011111001001001010010010100100101000110000000000"));
    font['7'] = std::bitset<48>  (std::string("100000001000000010000110100110001110000000000000"));
    font['8'] = std::bitset<48>  (std::string("011011001001001010010010100100100110110000000000"));
    font['9'] = std::bitset<48>  (std::string("011000001001000010010000100100000111111000000000"));
    font[':'] = std::bitset<48>  (std::string("000000000000000001000100000000000000000000000000"));
    font[';'] = std::bitset<48>  (std::string("000000000000000001000110000000000000000000000000"));
    font['<'] = std::bitset<48>  (std::string("000000000001000000101000010001000000000000000000"));
    font['='] = std::bitset<48>  (std::string("001010000010100000101000001010000000000000000000"));
    font['>'] = std::bitset<48>  (std::string("000000000100010000101000000100000000000000000000"));
    font['?'] = std::bitset<48>  (std::string("010000001000000010001010100100000110000000000000"));
    font['@'] = std::bitset<48>  (std::string("011111001000001010111010101010100111001000000000"));
    font['A'] = std::bitset<48>  (std::string("011111101001000010010000100100000111111000000000"));
    font['B'] = std::bitset<48>  (std::string("111111101001001010010010100100100110110000000000"));
    font['C'] = std::bitset<48>  (std::string("011111001000001010000010100000100100010000000000"));
    font['D'] = std::bitset<48>  (std::string("111111101000001010000010100000100111110000000000"));
    font['E'] = std::bitset<48>  (std::string("111111101001001010010010100100101000001000000000"));
    font['F'] = std::bitset<48>  (std::string("111111101001000010010000100100001000000000000000"));
    font['G'] = std::bitset<48>  (std::string("011111001000001010000010100010100100110000000000"));
    font['H'] = std::bitset<48>  (std::string("111111100001000000010000000100001111111000000000"));
    font['I'] = std::bitset<48>  (std::string("100000101000001011111110100000101000001000000000"));
    font['J'] = std::bitset<48>  (std::string("000011000000001000000010000000101111110000000000"));
    font['K'] = std::bitset<48>  (std::string("111111100001000000010000001010001100011000000000"));
    font['L'] = std::bitset<48>  (std::string("111111100000001000000010000000100000001000000000"));
    font['M'] = std::bitset<48>  (std::string("111111101000000001100000100000001111111000000000"));
    font['N'] = std::bitset<48>  (std::string("111111100100000000100000000100001111111000000000"));
    font['O'] = std::bitset<48>  (std::string("011111001000001010000010100000100111110000000000"));
    font['P'] = std::bitset<48>  (std::string("111111101001000010010000100100001111000000000000"));
    font['Q'] = std::bitset<48>  (std::string("011111001000001010001010100001000111101000000000"));
    font['R'] = std::bitset<48>  (std::string("111111101001000010010000100110001111011000000000"));
    font['S'] = std::bitset<48>  (std::string("011000101001001010010010100100101000110000000000"));
    font['T'] = std::bitset<48>  (std::string("100000001000000011111110100000001000000000000000"));
    font['U'] = std::bitset<48>  (std::string("111111000000001000000010000000101111110000000000"));
    font['V'] = std::bitset<48>  (std::string("111110000000010000000010000001001111100000000000"));
    font['W'] = std::bitset<48>  (std::string("111111100000001000001100000000101111111000000000"));
    font['X'] = std::bitset<48>  (std::string("110001100010100000010000001010001100011000000000"));
    font['Y'] = std::bitset<48>  (std::string("110000000010000000011110001000001100000000000000"));
    font['Z'] = std::bitset<48>  (std::string("100001101000101010010010101000101100001000000000"));
    font['['] = std::bitset<48>  (std::string("000000001111111010000010100000100000000000000000"));
    font['\''] = std::bitset<48>  (std::string("100000000110000000010000000011000000001000000000"));
    font[']'] = std::bitset<48>  (std::string("000000001000001010000010111111100000000000000000"));
    font['^'] = std::bitset<48>  (std::string("001000000100000010000000010000000010000000000000"));
    font['_'] = std::bitset<48>  (std::string("000000100000001000000010000000100000001000000000"));
    font['`'] = std::bitset<48>  (std::string("000000001000000001000000000000000000000000000000"));
    font['a'] = std::bitset<48>  (std::string("000001000010101000101010001010100001111000000000"));
    font['b'] = std::bitset<48>  (std::string("111111100001001000010010000100100000110000000000"));
    font['c'] = std::bitset<48>  (std::string("000111000010001000100010001000100001010000000000"));
    font['d'] = std::bitset<48>  (std::string("000011000001001000010010000100101111111000000000"));
    font['e'] = std::bitset<48>  (std::string("000111000010101000101010001010100001101000000000"));
    font['f'] = std::bitset<48>  (std::string("000100000111111010010000100100000000000000000000"));
    font['g'] = std::bitset<48>  (std::string("001100100100100101001001010010010011111000000000"));
    font['h'] = std::bitset<48>  (std::string("111111100001000000010000000100000000111000000000"));
    font['i'] = std::bitset<48>  (std::string("000000000000000001011110000000000000000000000000"));
    font['j'] = std::bitset<48>  (std::string("000000100000000100000001010111100000000000000000"));
    font['k'] = std::bitset<48>  (std::string("111111100000100000010100001000100000000000000000"));
    font['l'] = std::bitset<48>  (std::string("000000000000000011111110000000000000000000000000"));
    font['m'] = std::bitset<48>  (std::string("000111100001000000001000000100000001111000000000"));
    font['n'] = std::bitset<48>  (std::string("001111100001000000010000000100000001111000000000"));
    font['o'] = std::bitset<48>  (std::string("000111000010001000100010001000100001110000000000"));
    font['p'] = std::bitset<48>  (std::string("001111110010010000100100001001000001100000000000"));
    font['q'] = std::bitset<48>  (std::string("000110000010010000100100001001000011111100000000"));
    font['r'] = std::bitset<48>  (std::string("000000000011111000010000000100000000000000000000"));
    font['s'] = std::bitset<48>  (std::string("000000000001001000101010001010100010010000000000"));
    font['t'] = std::bitset<48>  (std::string("000000000010000011111110001000000000000000000000"));
    font['u'] = std::bitset<48>  (std::string("000111000000001000000010000000100001110000000000"));
    font['v'] = std::bitset<48>  (std::string("000110000000010000000010000001000001100000000000"));
    font['w'] = std::bitset<48>  (std::string("000111100000001000000100000000100001111000000000"));
    font['x'] = std::bitset<48>  (std::string("001000100001010000001000000101000010001000000000"));
    font['y'] = std::bitset<48>  (std::string("001100000000100000000111000010000011000000000000"));
    font['z'] = std::bitset<48>  (std::string("010001100100101001010010011000100000000000000000"));
    font['{'] = std::bitset<48>  (std::string("000000000000000001101100100100100000000000000000"));
    font['|'] = std::bitset<48>  (std::string("000000000000000011111110000000000000000000000000"));
    font['}'] = std::bitset<48>  (std::string("000000000000000010010010011011000000000000000000"));
    font['~'] = std::bitset<48>  (std::string("000100000010000000010000000010000001000000000000"));
}

main.cpp
#include "PPMDraw.h"
#include <iostream>

int main(){
    // ask for input
    std::string input;
    std::cout << "ENTER YOUR TEXT" << std::endl;
    getline(std::cin, input);
   // get size for image
  int width = input.size() * 6;
   PPMDraw image = PPMDraw(width, 8);
   image.fill(255, 255, 255);
   image.set_color(0, 0, 0);
   image.draw_string(0, 0, input);
   image.save("text.ppm");
}

Makefile
CC = g++
CFLAGS = -Wall -c -std=c++11
LFLAGS = -Wall
OBJS = main.o PPMDraw.o

list: $(OBJS)
    $(CC) $(LFLAGS) $(OBJS) -o text2ppm

main.o: PPMDraw.h
    $(CC) $(CFLAGS) main.cpp

PPMDraw.o: PPMDraw.h
    $(CC) $(CFLAGS) PPMDraw.cpp

clean:
    rm *.o main

If you're interested, the full PPMDraw library is here:

I found your fonts very useful!

SmileBASIC, 231 bytes
LINPUT C$?"P1
?8,LEN(C$)*8WHILE""<C$A=ASC(SHIFT(C$))D=ASC("*N.JZ`;O:²ÞøäüÄho"[A-65+12*(A<34)+47*(A<47)])FOR I=0TO 4B$=BIN$(VAL("7535712074617252"[D>>5<<1OR 1AND D>>I]),8)WHILE""<B$?POP(B$),
WEND?NEXT?"0 "*24WEND

Each character contains only 2 different row patterns, chosen from a "palette" of 8 combinations.
The data for each symbol is stored in 1 byte, with the palette stored separately.


text:
Ascending Pea Pattern generator
For those who are not familiarized with the Pea Pattern, it is a simple mathematical pattern.
There are multiple variations of this pattern, but we will focus in one:

Ascending  Pea Pattern

It looks like this:
1
11
21
1112
3112
211213
...

It seems really hard to get the following line, but it is really easy. The way to get the next line is by counting the number of times a digit have repeated on the previous line (start counting with the lowest, to largest):
one
one one
two ones
one one, one two
three ones, one two
two ones, one two, one three
...

Requirements/Rules:

We will start at 1
It will be a snippet
There must be a way to specify the number of lines generates (e.g 5
will give the first 5 lines)
The code should be as short as possible
It must start counting from lowest to largest (the Ascending
variation)

I am new here, please tell me how can I improve. For example, should I specify a date limit?

You could specify whether you want a full program with I/O or a snippet is enough (or if you don't care.)  But it looks well-specified enough at first glance.

@JB Thanks for your enlightening words. I have updated my post

Related: http://codegolf.stackexchange.com/questions/2323/look-and-say-sequence

The 13th iteration, and all subsequent iterations, are 21322314.  Is this correct?

@JoeyAdams That's what I get, and the wiki page linked above seems to confirm it.

APL, 32 characters
⍪⌽({⍵,⍨,/{⌽⍵,+/⍵⍷d}¨⍳⌈/d←⊃⍵}⍣⎕)1

This generates lines starting from 0 (i.e. 0 generates 1, 1 generates 1 followed by 1 1, etc.), as specified by user input. I used Dyalog APL for this, and ⎕IO should be set to its default of 1.
Example:
      ⍪⌽({⍵,⍨,/{⌽⍵,+/⍵⍷d}¨⍳⌈/d←⊃⍵}⍣⎕)1
⎕:
      0
1

      ⍪⌽({⍵,⍨,/{⌽⍵,+/⍵⍷d}¨⍳⌈/d←⊃⍵}⍣⎕)1
⎕:
      13
               1
             1 1
             2 1
         1 1 1 2
         3 1 1 2
     2 1 1 2 1 3
     3 1 2 2 1 3
     2 1 2 2 2 3
     1 1 4 2 1 3
 3 1 1 2 1 3 1 4
 4 1 1 2 2 3 1 4
 3 1 2 2 1 3 2 4
 2 1 3 2 2 3 1 4
 2 1 3 2 2 3 1 4

Once I get some more time, I'll write up an explanation. ⍨

Python (2.x), 81 80 characters
l='1'
exec"print l;l=''.join(`l.count(k)`+k for k in sorted(set(l)))\n"*input()

All tips or comments welcome!
usage: python peapattern.py
15 # enter the number of iterations
1
11
21
1112
3112
211213
312213
212223
114213
31121314
41122314
31221324
21322314
21322314
21322314

J, 60 46 39 26 characters
1([:,(#,{.)/.~@/:~)@[&0~i.

Edit 3: Came up with a much nicer way of expressing this.
1([:;[:|."1[:/:~~.,.[:+/"1[:~.=)@[&0~i.

Edit 2: Finally found a way to move the argument to the end of the sequence and get rid of the unnecessary assignment stuff.
Previously:
p=.3 :'([:,[:|."1[:/:~~.,.[:+/"1[:~.=)^:(i.y)1

Edit 1: Fixes the output which should be y rows rather than the yth row. Also shortens things a bit. Shame about the 0s, can't seem to get rid of the damn things.
Usage:
   1([:,(#,{.)/.~@/:~)@[&0~i. 1
1

   1([:,(#,{.)/.~@/:~)@[&0~i. 6
1 0 0 0 0 0
1 1 0 0 0 0
2 1 0 0 0 0
1 1 1 2 0 0
3 1 1 2 0 0
2 1 1 2 1 3

   1([:,(#,{.)/.~@/:~)@[&0~i. 10
1 0 0 0 0 0 0 0
1 1 0 0 0 0 0 0
2 1 0 0 0 0 0 0
1 1 1 2 0 0 0 0
3 1 1 2 0 0 0 0
2 1 1 2 1 3 0 0
3 1 2 2 1 3 0 0
2 1 2 2 2 3 0 0
1 1 4 2 1 3 0 0
3 1 1 2 1 3 1 4

Admittedly the usage is uglier now, but prettiness isn't the name of the game here...

This will be hard to beat with any 'traditional language'. Maybe golfscript or similar is up to the task ;-)

Perl, 83
I'm pretty sure some Perl guru could outdo this, but here goes:
$_++;$n=<>;for(;$n--;){print$_.$/;$r='';$r.=length($&).$1 while(s/(.)\1*//);$_=$r;}

Expanded:
$_++;$n=<>;

for(;$n--;)
{
    print $_.$/;

    $r='';$r .= length($&).$1 while (s/(.)\1*//);  # The magic
    $_=$r;
}

Number of rows is passed in via STDIN.

Not quite a guru, I'm sure there are even shorter ways to be found, but 46 using pretty much the same method: Try it online!

Haskell, 116
import Data.List
main=interact(unlines.map(show=<<).($iterate((>>=
 \x->[length x,head x]).group.sort)[1]).take.read)

Usage:
$ runhaskell pea.hs <<< 15
1
11
21
1112
3112
211213
312213
212223
114213
31121314
41122314
31221324
21322314
21322314
21322314

Common Lisp, 140 characters
(defun m(x)
  (labels((p(l n)
    (if(= 0 n)
       nil
       (cons l
             (p(loop for d in(sort(remove-duplicates l)#'<)
                  append(list(count d l)d))
               (1- n))))))
    (p'(1) x)))

This is Lisp, so the function returns a list of lists. (m x) generates X sublists.

Mathematica, 70
NestList[FromDigits@TakeWhile[DigitCount@#~Riffle~Range@9,#>0&]&,1,#]&

Jelly, 13 11 bytes (Feedback appreciated)
1ṢŒrUFƲÐ¡ṖY

Try it online!
1ṢŒrUFƲÐ¡ṖY
1     Ʋ         starting with 1, run these 4 links...
 ṢŒr            Ṣort the list and get the Œrun-length encoding of it,
    U           reverse each member of the RLE list (so it goes [repetitions, digit] instead of [digit, repetitions]),
     F          and Flatten the RLE list-of-lists to just a list of digits, which is the next number.
       Ð¡       do that (input) number of times,
         ṖY     Ṗop the last line off the output (an extra line is always calculated) and then print the numbers, separated by newlines.

U€ can just be U, it vectorizes down to the row level. Then you can save another byte inlining ṢŒrUF, using Ʋ (last 4 links as monad): 1ṢŒrUFƲÐ¡ṖY

Thanks again so much for the improvements @Lynn! Always nice to go from a string of 5+ links to 4 so you can use that quick.

You're welcome! (Tiny note: ṢŒrU€FƲ would have worked just fine -- it rolls [Ṣ, Œr, U€, F] into a monad. Maybe my use of "then" was a little misleading ^^; Similarly, in something like abc$de$fƲ will operate on the 4 links [a, bc$, de$, f] and roll them into a monad. This is the sense in which you can think of quicks as "parse-time stack operators": their outcome is pushed back onto a stack, and acts as if it were one link for future quicks.)

@Lynn I see, thank you again! Getting a lot better at "counting" links now, was able to completely inline this answer and save a byte thanks to your comment!

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Make something tasty!
Your challenge is to write a Chef program that works well as a recipe and also as a program. Its utility as a recipe is strictly required (I don't want a recipe for grapeleaves in chocolate-mustard sauce); its utility as a program is a looser requirement, so that it is enough to print something interesting (the first few integers, for example, or "just another chef", or "just another Chef hacker", or "hello world") or do some helpful calculation (printing the sum of two numbers, for example). Votes should take this into account, and the winner is the program with the most net upvotes after some time.
(Code length is not important here.)

I'm not sure it's worth having a tag for it. Tags are to categorise related questions, and it doesn't seem too likely that we'll have more than one question about Chef.

I wrote this program for another challenge, but I decided to try and make it a valid answer for this one too:
Shirred Eggs.

This recipe prints the number 2 and, in doing so, yields two delicious
shirred eggs.

Ingredients.
2 eggs

Cooking time: 12 minutes.

Pre-heat oven to 175 degrees Celsius.

Method.
Put eggs into mixing bowl. Pour contents of the mixing bowl into the
baking dish. Shirr the eggs. Bake the eggs until shirred.

Serves 1.

As I mentioned in the other answer, it seems pretty hard to write anything in Chef that involves something more complicated than mixing stuff in a bowl and baking it, and still have it work both as a program and as a recipe.
Edit: Changed the recipe from fried to shirred eggs — thanks to Blazer for the suggestion!  The cooking time and temperature should be considered advisory only; I haven't actually tried the recipe yet myself, so I can't vouch for their accuracy.

Waitaminute: as is, this outputs 1, not 2. ("Fry the eggs until baked" decrements eggs.) No?

I tested this using the Acme::Chef interpreter, and it outputs 2.  The last two sentences in the "Method" section don't actually affect the output at all (since it's already been moved to the baking dish), they're just there to tell you not to eat the eggs raw.

Ah, of course: quite right.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
HangOver ACM problem!
there is only one rule: get accept for this problem http://acm.ut.ac.ir/sc/problemset/view/1032!
to submit your code, you need to create an account(if you don't want to do so, just post your code here and I'll submit it). so far shortest code is written with C and has 85 character length.
winner will be the shortest C/C++ code submitted before 2012/02/01
note: to check shortest codes submitted you can click on "accepted runs" and then "code length"
as elssar suggested I've copied the question here :
How far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length. (We're assuming that the cards must be perpendicular to the table.) With two cards you can make the top card overhang the bottom one by half a card length, and the bottom one overhang the table by a third of a card length, for a total maximum overhang of 1/2 + 1/3 = 5/6 card lengths. In general you can make n cards overhang by 1/2 + 1/3 + 1/4 + ... + 1/(n + 1) card lengths, where the top card overhangs the second by 1/2, the second overhangs tha third by 1/3, the third overhangs the fourth by 1/4, etc., and the bottom card overhangs the table by 1/(n + 1). This is illustrated in the figure below.
figure http://acm.ut.ac.ir/sc/assets/problem_images/1032_50ac13c53158fd843d1884e8afa962dd.jpg
Input
The input consists of one or more test cases, followed by a line containing the number 0.00 that signals the end of the input. Each test case is a single line containing a positive floating-point number c whose value is at least 0.01 and at most 5.20; c will contain exactly three digits.
Output
For each test case, output the minimum number of cards necessary to achieve an overhang of at least c card lengths. Use the exact output format shown in the examples.
Sample Input
1.00
3.71
0.04
5.19
0.00
Sample Output
3 card(s)
61 card(s)
1 card(s)
273 card(s)

Would be nice if you copied the question over here.

I just saw a guy on 9gag that recently posted an image of this :)

Shouldn't there be 5 outputs for 5 inputs?

I know the problem says C/C++, but that's for the ACM site. Can we post answers in other languages here on CG?

@trinithis 0 is used to terminate input, so it's not really an input to program. In any case, the answer for 0 would be trivial - 0

why should this not be language-agnostic? Allright, this ACM site doesn't seem to accept many languages, but it would be easy to write a test script which does. — 2. this pretends to be a physics problem, but it's readily seen that the harmonic series does not predict the correct maximum overhang: the center of mass of the uppermost two cards is in the middle of their intersection, but the next card below only reaches 1/3 into that intersection, so the uppermost cards would tip over.

The correct solution is actually a harmonic series, but not 1/2 + 1/3 + ... but 1/2 (1 + 1/2 + 1/3 + ...).

@leftaroundabout that really doesn't matter right now! it was actually a challenge between me and a bunch of my friends.

C, 149 89
Well, this was a noobish shot at it, but probably a decent starting point:
#include <cstdio>
float i;
int o(float a,int n=2){return a<0?n-2:o(a-1./n,n+1);}
main(){if (scanf("%f",&i),i==0) return 0;printf("%d card(s)\n",o(i));main();}

It reported as 145 characters.

With a push in the right direction, I got the solution down to 122 by changing the function to a for loop.
#include <cstdio>
float i;
main(){
if (scanf("%f",&i),i==0) return 0;
int n=2;for(;i>0;)i-=1./n++;
printf("%d card(s)\n",n-2);
main();}

On a roll!
#include <cstdio>
main()
{
    float i,n=2;
    for(scanf("%f",&i);i>0;i-=1/n++);
    if (n-=2) printf("%.0f card(s)\n",n), main();
}

Scooted scanf, for loop division doesn't need 1. any more, adjusting n now done in conditional.

Switched over to C, got some good savings.  Down to 89 characters.
main(n)
{
    float i;
    for(scanf("%f",&i);i>0;i-=1./++n);
    if (--n) printf("%d card(s)\n",n), main(1);
}

A for( loop is probably going to be more concise than a recursive function for the calculation in o(.  Maybe something like main(){if (scanf("%f",&i),i==0) return 0;for(n=2;i>0;n++)i-=1./n;printf("%d card(s)\n",n-2);main();} (if I understand your logic correctly). (Demo: http://www.ideone.com/CgFbp)  Also there are some extra spaces that can be removed (ex. between if ( and ) return).

Turns out that the way the program is judged, whitespace doesn't matter (which is actually kinda nice for readability).

A few more optimizations: main(){scanf("%f",&i);for(n=2;i>0;i-=1./n++);n-=2;if(n)printf("%d card(s)\n",n),main();} Edit: Just tried submitting it, was accepted as 115 characters :).  I removed return statement, moved check for i==0 to be instead a check of if(n) toward the end.

Got 3 more characters off: Combine definitions to float i,n=2; and change printf to use %.0f to round the float value.

You can shave off just a bit more by defining and initializing n just before the for loop:
int n=2;for(;i>0;i-=1./n++)

Moved scanf into for( initialize, and use n-2 instead of n-=2 (from my last solution) and I saved 2 more, down to 110 characters currently (http://www.ideone.com/koW7Y).  I have a feeling that the final optimizations will not be possible without switching to C first.

Hmm.. I had tried if (n-=2) and got an error.  Oh well, you can save one more character by moving the scanf( into the first part of the for( :)

As I said so far there is an answer with 85 characters written in C99 (note that white spaces are not counted)
main(i){for(float x;i=scanf("%f",&x),x;printf("%d card(s)\n",--i))for(;x>0;x-=1./++i);}

that was the whole code, hope It gives you the idea how to optimize it!

It seems we were on similar paths then...  I'm currently 4 characters higher, but making good progress (I think).
If anything, I'm glad to have come close without knowing the current best entry.

I know two other codes (almost the same as this one) with 85 characters, but so far I couldn't find anything better than This


text:
Find columns where all characters are the same
I came across this question on SO and thought it'd make a nice golf challenge.  So here it is:
Challenge:
Write a program that reads a sequence of character strings, one per line, and outputs a list of all positions where each string has the same character.
Input and output:
The input consists of one or more lines of printable non-whitespace ASCII characters, each followed by a newline.  You may assume that all input lines have the same length.  The newline is not to be considered part of the input (i.e. you should not output it as a matching character).
Example input (shamelessly stolen from the SO question):
abcdefg
avcddeg
acbdeeg

After reading the input, your program should print the positions of each matching column and the characters they contain.  (Your program may, but need not, stop reading further input if it can determine early that there are no matching columns.)  Any reasonable output format is permitted; in particular, you may use either 0-based or 1-based indexing for the positions.
Example output for the above input (using 0-based indexing):
0: a
3: d
6: g

Scoring:
This is code golf, so shortest answer wins.  In the event of a tie, fractional tie-breaker chars may be awarded for additional features:

−½ chars for correctly handling input lines of unequal length.  (Output should not contain positions past the end of the shortest input line.)
−¼ chars for correctly handling input consisting of arbitrary UTF-8 encoded Unicode characters.

For inspiration, you may find some ungolfed solutions at the SO question (see above).
Clarifications:

Simply concatenating the positions and characters, as in 0a3d6g, does not count as "reasonable output".  You should provide some kind of separator (such as a space) between each element of the output so that it can be parsed unambiguously.
The input will be provided on the standard input stream (stdin), or using whatever text file input mechanism is most natural to your language of choice.  (If your chosen language doesn't have a natural mechanism for file input, do whatever seems closest in spirit.)
The input ends when there is no more data to be read (i.e. when an end-of-file condition occurs).  If you wish, you may require that the input be terminated by a blank line (which you then should not count as part of the input, obviously).  If you do so, please mention it in your answer so that others can provide correct input for testing.
Every input line, including the last one, ends with a newline character.  Your answer must not report this newline as a matching column.  (It's fine if your solution can also handle input where the last line doesn't end in a newline, but that's not required.)

So does a blank line terminate input?

"You should provide some kind of separator between each element of the output so that it can be parsed unambiguously."  Does a space count as a seperator?

@StevenRumbalski: The input ends when there's no more data to read; I guess I can allow a trailing blank line if your language has trouble detecting EOF.  And yes, a space is a perfectly good separator.

Can we have some arbitrary UTF-8 encoded Unicode characters sample code?

05AB1E (legacy), score: \$9\frac{1}{4}\$ (10 bytes - \$\frac{3}{4}\$ for both bonuses)
|ø€Ùā‚øʒнg

Outputs with 1-based indexing.
Try it online.
Uses the legacy version, because ø worked with a list of strings whereas the new version would need an explicit €S to convert each inner string to a list of characters first. It does mean I can't use the builtin .ā of the new version though, which pairs each item with its 0-based index. As alternative I use ā‚ø to pair with its 1-based index.
In the new 05AB1E version this would therefore have been 11 bytes: |€Sø€Ù.āʒнg - Try it online (with 0-based indexing instead).
Explanation:
|           # Push all input-lines as a list
 ø          # Zip/transpose; swapping rows/columns,
            # which implicitly discards any trailing characters for the 1/2 bonus
  €Ù        # Uniquify each inner string/character-list
    ā       # Push a list in the range [1, length] (without popping the list of strings)
     ‚      # Pair it with the list of strings
      ø     # Zip/transpose again, which pairs each string with its 1-based index
       ʒ    # Filter this list of string-index pairs by:
        н   #  Where the first item (the string)
         g  #  Has a length equal to 1 (note: only 1 is truthy in 05AB1E)
            # (after which the result is output implicitly)

APL, 25 characters
∩/{0=⍴⍵:⍬⋄(⊂⍵,⍨¨⍳⍴⍵),∇⍞}⍞

I used Dyalog APL (version 13) as my interpreter. It handles both inputs of unequal length and Unicode (UTF-8) characters.
Examples:
      ∩/{0=⍴⍵:⍬⋄(⊂⍵,⍨¨⍳⍴⍵),∇⍞}⍞
abcdefg
avcddeg
acbdeeg

  1 a  4 d  7 g

      ∩/{0=⍴⍵:⍬⋄(⊂⍵,⍨¨⍳⍴⍵),∇⍞}⍞
test日本
blat日本国foo

  4 t  5 日  6 本

Explanation, somewhat from right to left:

The main chunk of this answer is the direct function (basically, anonymous function), defined within the curly braces. Its right argument is specified by ⍵.

0=⍴⍵:⍬ is our first expression, and it checks if we've gotten an empty line (i.e., we are done). It uses a guard (a familiar construct to many functional programmers) to conditionally execute the expression to the right of the colon. In this case, if 0 is equal to the shape/length (⍴) of the right argument, we return the empty set (⍬).
⋄ separates the two expressions within the function. If the previous expression didn't get evaluated (and thus didn't return anything), we move to the next expression.
We recursively call the function using the self-reference function (∇). The argument to the function is a line of non-evaluated user input, given by quote-quad (⍞).
⊂⍵,⍨¨⍳⍴⍵ creates pairs for each character in the string, where each pair's first element is its position in the string, and its second element is the character.
⍳⍴⍵ gives a vector from 1 to ⍴⍵, or the length of the input string.
⍵,⍨¨ applies the commuted concatenation function (,⍨) to each (¨) element to its left (⍵, in this case the user's input) and right. Commuting the concatenation function causes its left and right arguments to be swapped.
Finally, we enclose the result using ⊂, so that we can differentiate between lines of input.

We initially feed our function with user input (⍞).
Finally, we reduce (/) our resulting vector of vectors of pairs using the intersection function (∩), yielding the pairs that are found in all of the sub-vectors.

For no good reason I have a visceral negative response whenever I see APL that I don't have for J or GolfScript.  But +1 anyway for an excellent solution.

I've actually been thinking about switching to J... I'll tack that on my list of reasons. :)

Golfscript (28 chars)
n/zip:^,,{.^=.&.,1>{;;}*}%n*

There are character set issues when piping Unicode through, so no quarter-point bonus.

+1.  This should not have less upvotes than my answer.

J, 57 51 44 40 characters
,.&.>y;y{{.z[y=.I.*/2=/\]z=.];._2]1!:1]3

I'm getting there slowly but surely. This is still far from ideal though I think.
I felt sure that using a hook would be the answer but unfortunately not (44 chars):
,.&.>((];({{.)~)([:I.[:*/2=/\]))];._2]1!:1]3

I may need a completely different method to get any shorter.

+1.  But yes, I expect better from J.

This should not have less upvotes than my answer.

@StevenRumbalski The upvotes don't always reflect the relative sizes of the code. It sometimes becomes a language popularity contest. I agree that the golfscript answer should be up there with the APL, unfortunately I've already given it my upvote and can't help push it up further.

Python 2, score 81.5 (116 94 86 83 82 bytes minus bonus)
import sys
i=0
for x in zip(*sys.stdin)[:-1]:
 i+=1
 if len(set(x))<2:print i,x[0]

+1 for a nice Python golf but You can lose a whole FOUR characters:  [:-1] isn't necessary unless to strip off an extraneous newline at the end of the input (which does not even seem to be there in the question).

@ChristopheD:  Actually, the result of zip(*sys.stdin) is [('a', 'a', 'a'), ('b', 'v', 'c'), ('c', 'c', 'b'), ('d', 'd', 'd'), ('e', 'd', 'e'), ('f', 'e', 'e'), ('g', 'g', 'g'), ('\n', '\n', '\n')].  I don't see a way around avoiding stripping that last tuple of newlines.  Please correct me if I've misunderstood.  Thank you for the upvote.

If you remove the last newline in your data file the tuple for that line isn't complete (misses one '\n' so zip only considers and returns the data we are looking for, allowing the removal of [:-1]. E.g. zip([1,2,3,4],[1,2,3])=> [(1, 1), (2, 2), (3, 3)]

@ChristopheD: Per spec, "input consists of [...] lines [...], each followed by a newline."

Steven Rumbalski, @Ilmari Karonen: Sorry, did not see that in the spec.

Save a character: len(set(x))<2

@Clueless:  Thank you for the one character.  The two characters required for == bothered me.

Would the person who downvoted this answer explain why?

FYI: I didn't (still +1) I rarely downvote - not a single one on codegolf.se yet) and if I do i always leave a comment. Just wanted to make sure you knew this since I previously commented on your answer.

@ChristopheD.  I didn't mean to imply that you downvoted.  I really don't care who downvoted.  Since downvotes seem pretty rare on codegolf.se I'm curious to know the criticism.  It could be something as simple as correcting for the inequity of my answer being in fifth place with respect to character count, but tied for 2nd in votes.

Haskell, 64 characters
main=interact$show.foldl1(filter.flip elem).map(zip[0..]).lines

Handles lines of unequal length. Unicode support depends on the current locale settings.
Example output:
[(0,'a'),(3,'d'),(6,'g')]

+1.  This should not have less upvotes than my answer.

(Bash) Shell Scripting, 105 characters
If anyone has some more tricks for this, please fill free to comment!
for((i=1;i<`tail -1 $1|wc -c`;i++))do
x="cut -c$i $1";y=`$x`;[ `$x|uniq|wc -l` = 1 ]&& echo $i ${y:3};done

Result:

1 a
4 d
7 g

I'm having trouble getting this to work; running this on the sample input prints a series of errors like /tmp/cols.sh: line 2: [1: command not found and nothing else.

@Ilmari Karonen: this was tested on a Mac (snow leopard, 10.6.2) but should work elsewhere. I'see to have it fixed on Linux tomorrow (should be a small fix)

ormaaj lacked the rep but wanted to comment: it breaks for Ilmari because of a missing space after the [; and the ${y:3} will cause it to only work with exactly 3 lines of input. Fixing and optimising yields (100 chars) while((++i%\tail -1 $1|wc -c`));do x=`cut -c$i $1`;((`uniq|wc -l`==1))<<<"$x"&&echo $i ${x: -1};doneand using default values should allow saving one more withfor((;++i<`tail -1 $1|wc -c`;))do` but there is an unfixed bug in bash.

Perl, 87 characters (−½ char tie-break bonus)
Here's a golfed version of my own solution from the SO thread:
chomp($a=$b=<>);$a&=$_,$b|=$_ for<>;@$_=$$_=~/./sgfor a,b;$b[$i++]eq$_&&say"$i:$_"for@a

Unlike the SO version, this one uses 1-based indexes for the output.  It uses the Perl 5.10 say feature, so needs to be run with perl -M5.010 (or with perl -E).
Like the SO version, this code handles variable-length lines, and would handle arbitrary Unicode input if the standard input and output were in UTF-8 mode.  Alas, by default they're not, unless one specifies the non-free -CS command line switch.  Thus, it earns the −½ char bonus, but not the −¼ one.
Edit: +1 char to fix a bug: just because the input strings don't contain line feeds doesn't mean they can't end up in $a (e.g. "+" & "J" eq "\n").

You could save 1 char by using chop instead of chomp.

@M42: Good point, although I rather like the robustness of the current version.  I think I'll keep the m for now, it's not like it makes any difference to the rankings at the moment. :)

T-SQL
SELECT N.number, letter = MIN(SUBSTRING(L.line, N.number, 1))
FROM Lines AS L
INNER JOIN master.dbo.spt_values AS N ON N.type = 'P'
WHERE N.number BETWEEN 1 AND (SELECT MAX(LEN(L2.line)) FROM Lines AS L2)
GROUP BY N.number
HAVING COUNT(DISTINCT SUBSTRING(L.line, N.number, 1)) = 1
ORDER BY N.number

Hi Anthony, welcome to codegolf. Nice answer - however you are suppose to make it as short as possible. Spaces, long variable names,naming columns, ORDER BY can be omitted, it would be easy to cut away 100+ characters. You should also include the number of characters used in the header. You may find some inspiration in my answer, which is currently half the length

Q, 32
{a!((*:)x)a:(&)1=(#:')(?:')(+)x}

usage
q){a!((*:)x)a:(&)1=(#:')(?:')(+)x}[("abcdefg";"avcddeg";"acbdeeg")]
0| a
3| d
6| g

K, 22
The above solution can be reduced to 22 by writing it completely in K rather than passing K functions to a Q interpreter, reducing the number of parentheses required.
{a!@[*x]a:&1=#:'?:'+x}

Scala 115107: (−¼ for handling UTF-8)
io.Source.stdin.getLines.map(_.zipWithIndex).toList.flatten.groupBy(_._2).map(_._2.toSet).filter(_.size==1)

ungolfed, and Source.fromFile ("f") instead of stdin for better testability:
io.Source.fromFile ("f").
  getLines.map (_.zipWithIndex).
    toList.flatten.groupBy (_._2).
      map (_._2.toSet).
        filter (_.size==1)

Result:
List(Set((a,0)), Set((g,6)), Set((d,3)))

Thanks to Gareth for the reduction of size 8 for using stdin.

Can't you use stdin instead of fromFile("f") to save 8 characters?

VBA (307.25 284 - 0.75 bonus = 283.25)
I know this has already been won, but here's my shot (not reading a file, just a string - needs to have the io added). I like that I got to use l() recursively. I usually don't have a need for recursion my real-life programming. I only did so much testing, but I believe this covers the unicode bonus point stipulation. It also assumes vbCr is the line terminator. This may not translate to all systems because of that.
Code:
Function a(i)
b=Split(Left(i,Len(i)-1),vbCr):c=UBound(b):For q=1 To Len(b(c)):d=Mid(b(c),q,1):If l(b,c,q,d) Then a=a & q & ": " & d & vbCr:Next
End Function
Function l(m, n, o, p)
If n+1 Then l=IIf(o<=Len(m(n)),Mid(m(n),o,1)=p,0) And l(m,n-1,o,p) Else l=Mid(m(n+1),o,1)=p
End Function

Example input/output:
Debug.Print a("abcdefghijklmnop" & vbCr & "abcdefg" & vbCr & "abcabcghijkl" & vbCr)

1: a
2: b
3: c
7: g

JavaScript (125 134 140)
for(i=s=[];I=s[++i]=prompt(o='');S=I);for(c=-1;w=r=++c<S.length;o+=r?c+':'+C+'\n':'')for(C=S[c];w<i;)r&=s[w++][c]==C;alert(o)

Demo: http://jsfiddle.net/Fv7kY/4/
Edit 1: Rearrange loops to avoid braces. Initialize i with [] to combine with s.  Move w increment into expression.
Edit 2: Set S=I to capture last entered word and save using s[1].  Combine r=1 and ++c<S.length.  Set C=s[c] in inner loop and compare to C instead of previous and next words to shorten expression s[w][c]==s[w++][c] to just s[w++][c]==C.  Saved a total of 9 characters.  Also set w=r=... because when that's true w=1 which is what we need to initialize w with.

PHP, 123 127 :(
I'm not happy with it (there's bound to be improvements to be had), but here goes:
<?$a=$b=trim(fgets(STDIN));while($l=fgets(STDIN)){$a&=$l;$b|=$l;}$n=-1;while(@$a[++$n]){echo$a[$n]!=$b[$n]?'':"$n:{$a[$n]}\n";}

Proof it works.
If anyone can think of a more clever way of initializing $a and $b, please let me know.  Originally I had $a=$b=$n='' and $b eventually was correct, but [empty] & [anything] == [empty], so $a never had content.

Edit: Had to fix newline handling (+6) but dropped closing tag (-2).

I'm curious, why do you make most of your answers community wiki?

I didn't mean to on this one.  Long time ago when I first joined CodeGolf someone told me that it was standard.  Have to break the habit.  Can un-wiki it now though.
http://codegolf.stackexchange.com/a/2249/1419 (see comments)

I think it was the standard way of doing things on SO for code golf questions, but not here otherwise no-one would have any reputation at all. :-)

You could probably flag them and ask a moderator to un-CW them. Just explain that it was a mistake.

You could save two chars by leaving out the ?>.  However, I just noticed that your code has a bug: it prints an extra match if all lines contain a trailing newline as specified.

@IlmariKaronen - It only does that if the final line has a newline at the end of it.  If the input is newline delimited, it shouldn't be an issue. ;)

Yeah, but I did specify "lines [...] followed by a newline".  Sorry. :/

Common Lisp, 183 165 characters
(let((l(loop for m =(read-line)until(equal m "")collect m)))(loop for c across(car l)for i from 0 if(null(remove c(mapcar(lambda(y)(char y i))l)))collect(list i c)))

Readable format:
(let ((l (loop for m = (read-line) until (equal m "") collect m)))
  (loop for c across (car l)
        for i from 0
        if (null (remove c
                         (mapcar (lambda(y) (char y i))l)))
        collect(list i c)))

Enter this directly into the REPL and enter lines, terminating with an empty line.

Ruby (71)
a,*s=*$<.lines
(a.size-1).times{|i|s.all?{|t|t[i]==a[i]}&&p([i,a[i]])}

output:
[0, "a"]
[3, "d"]
[6, "g"]

Note: appears to require Ruby 1.9; for Ruby 1.8 compatibility, replace t[i] with t[i,1].

C, 126 chars
char a[999],b[999];main(i){for(gets(a);gets(b);)for(i=0;b[i];++i)a[i]^b[i]?a[i]=0:0;
while(i--)a[i]&&printf("%d:%c\n",i,a[i]);}

I've been staring at this but I just can't make it smaller. A new approach may be needed.
(No bonus points; it only handles differently-sized lines if the first line is the shorter one.)

Burlesque, 16 bytes
ln)XXtpzif{[~sm}

Try it online!
ln   # Split to lines
)XX  # Split each line to chars
tp   # Transpose
zi   # Zip with indices
f{   # Filter for
 [~  # Tail (i.e. chars)
 sm  # All the same
}

T-SQL, 134 bytes
This can handle input lines of unequal length
Using 0-based indexing
SELECT n,max(z)FROM(SELECT
substring(x,number+1,1)z,abs(number)n,*FROM spt_values,@)t
GROUP BY n
HAVING max(z)=min(z)and n<max(len(x))

Try it online

JavaScript (Node.js), 67 bytes (Anonymous function)
a=>[...a[0]].reduce((p,c,i)=>p+(a.every(s=>s[i]==c)?i+c+" ":""),"")

Try it online!
Input as array of lines, output in form "0a 2g 5p " etc

C# with .NET 4 (280)
using c=System.Console;class P{static void Main(){char[]a=c.ReadLine().ToCharArray();int r,i,l=a.Length;m:i=0;n:r=c.Read();if(r>0&&r!=10&&r!=13){if((int)a[i]!=r)a[i]='\0';i++;goto n;}for(;i>0&&i<l;)a[i++]='\0';if(r>0)goto m;for(i=0;i<l;i++)if(a[i]!='\0')c.WriteLine(i+":"+a[i]);}}

1 line, 280 characters
Includes all necessary using statements and Main method.
Program does not require an empty line at the end, but will accept it
Empty lines are ignored
Handles input strings of any length.
Reserves output until the end (whereas the original answer provided incremental output)

Readable version
    char[]a=c.ReadLine().ToCharArray();
    int r,i,l=a.Length;
    m:
    i=0;
    n:
    r=c.Read();
    if(r>0&&r!=10&&r!=13){
        if((int)a[i]!=r)
            a[i]='\0';
        i++;
        goto n;
    }
    for(;i>0&&i<l;)
        a[i++]='\0';
    if(r>0)
        goto m;
    for(i=0;i<l;i++)
        if(a[i]!='\0')
            c.WriteLine(i+":"+a[i]);

Original answer

    using c=System.Console;class P{static void Main(){char[]a;var b=c.ReadLine();a=b.ToCharArray();while(b!=""){for(int i=0;i

1 line
207 characters
Includes all necessary using statements and Main method.
Program ends when an empty line is entered.
Does not handle input strings that are shorter than the first.

Readable version:
    static void Readable()
    {
        char[]a;
        string b=System.Console.ReadLine();
        a=b.ToCharArray();
        while(b.Length>0)
        {
            for (int i = 0; i < a.Length; i++)
            {
                if (a[i] != b[i])
                {
                    a[i] = '\0';
                }
                else
                {
                    System.Console.WriteLine(i+": "+a[i]);
                }
            }
            b=System.Console.ReadLine();
        }
    }

When I run this on the test input in the challenge, I get 0: a 1: b 2: c 3: d 4: e 5: f 6: g 0: a 2: c 3: d 6: g 0: a 3: d 6: g.  The expected output would be 0: a 3: d 6: g.

@Ilmari Ok, but it outputs the columns/characters that are the same after each input line. If you're feeding in a file as the standard input, then the output might seem strange, but if you input manually, I think it makes sense. I will consider how to refactor, though.

Your solution crashes if any line is longer than the first line.

@Timwi Ah...thanks for pointing that out!

python 122 characters:
print("\n".join([str(i)+':'+str(x[0]) for i,x in enumerate(zip(*[tuple(x) for x in input().split()])) if len(set(x))<2]))

you don't need a space between ) and for. So instead of …str(x[0]) for i,x…, you can do …str(x[0])for i,x…. It also comes up at tuple(x) for and .split()])) if

Ruby (242)
s = %w{ abcdefg avcddeg acbdeeg aejdjeggd }
cols = []
s.sort{ |a, b| b.size <=> a.size }[0].size.times do |i|
  uneq=true
  l = s[0][i]
  s.each { |w| uneq = false if l != w[i] }
  cols << [l, i] if uneq
end
cols.each { |c| puts c.join('|') }

The intent of the challenge was to read the lines from standard input.  I'm willing to cut some slack for languages (like in-browser JavaScript) where that concept doesn't really exist, but Ruby does have STDIN (or ARGF or just plain gets).

ah okay. But considering STDIN accepts one line, is it to assume something like: "Enter in another line, or 'n' to stop"? Therefore create a loop to build an array.

I've added some clarifications to the question.  Basically, you should keep reading input lines until your reach end-of-file.

you have a ton of unnecessary whitespace.

C#
List<string> strings = new List<string> { "abcdefg", "avcddeg", "acbdeeg", "aejdjeggd" };
var transposes = from index in Enumerable.Range(0, strings.First().Length)
                 select new string((from s in strings select s[index]).ToArray());
int i = 0;
foreach(string transpose in transposes)
{
   if (transpose.Distinct().Count() == 1)
     Console.WriteLine("{0}: {1}", i , transpose[0]);
   i++;
}

Hi, Arjang, and welcome to codegolf.SE! A few comments on your answer: First, since this is a [tag:code-golf] challenge, you're expected to try to make your solution as short as possible; just to start with, you have some long variable names that you could easily shorten to single characters, and some excess whitespace you could remove. (It's fine to post a readable version of your code along with the "golfed" one, but you should actually post a golfed solution too.) Second, if you read the question carefully, I specified that you should read the strings from standard input, not hardcode them.


text:
First-n Fibonacci sequence elements
There is a well known question here that asks for a short (least characters) fibonacci sequence generator.
I would like to know if someone can generate the first N elements only, of the fibonacci sequence, in very short space.   I am trying to do it in python, but I'm interested in any short answer, in any language.  Function F(N) generates the first N elements of the sequence, either returns them as the return of the function or prints them.
Interestingly it seems that the code-golf answers start with 1 1 2, instead of 0 1 1 2. Is that a convention in code-golf or programming-in-general?  (Wikipedia says the fibonacci sequence starts with zero.).
Python Sample (First 5 Elements):
def f(i,j,n):
    if n>0:
        print i;
        f(j,i+j,n-1)
f(1,1,5)

I think this is too similar to the linked question. Most solutions there can easily be modified to handle the first-n case.

In the case of Python, the interesting thing is that I need four lines of code, and two levels of indentation in my sample. I suspect there is a one liner in python, but I can't find it.

I believe that the questions of "How does it start?" has a lot of history behind it, but I was usually taught starting with 1, 1. Does the Wikipedia give an authoritative source for  0, 1?

I remember it being introduced as 1, 1, .. in grade 7 when I was told about it.

Everywhere I've seen, the base cases are defined as F_0 = 0, F_1 = 1 or equivalently F_1 = 1, F_2 = 1. The difference is whether you want to start the sequence at index 0 (more common in programming) or 1 (more common in math).

And defining F_0 = 0, F_1 = 1 has a definite benefit in simplicity with the matrix representation [[1 1][1 0]]^n = [[F_{n+1} F_n][F_n F_{n-1}]].

@Peter: Now that a good reason to prefer one to the other (I'd long preferred 0, 1 on esthetic grounds, but don't believe those to be pressing in and of themselves).

I realize this is quite an old challenge at this point, but note that you've accepted an answer which is not the shortest. Since this is a code golf competition, the shortest answer should be the one that's marked accepted.

C
Didn't bother counting, but here's a fun example:
f(n){return n<4?1:f(--n)+f(--n);}
main(a,b){for(scanf("%d",&b);a++<=b;printf("%d ",f(a)));}

Proof it works.

I'm quite proud of this: I got bored, so I rearranged my code (with a few small additions) to make it where each line represents a value in the Fibonacci sequence.
                         #                                // 1
                         f                                // 1
                         //                               // 2
                        (n)                               // 3
                       {/**/                              // 5
                      return n                            // 8
                    <2 ? 1:f(--n)                         // 13
                +f(--n); } main(a, b)                     // 21
          {a = 0, b = 0;scanf("%d",&b); for(              // 34
;a < b; a+=1) { int res = f(a); printf("%d ", res); } }   // 55

Proof it works.

Nice. 90 chars (without newline). Save 2 bytes: a++<=b-> a++-b and return--n<3?1:f(n)+f(n-1). Plus you can avoid scanf if you require n to be in argc.

Love it! This is a great example of where the undefined behavior of the ordering of the two instances of --n in the same expression is irrelevant. Brilliant!

By the way, I think your 4 there should actually be a 3. As currently written with the <4, the sequence produced is 1, 1, 1, 2, 3, 5, 8... That's one too many 1's.

Additionally, if you want to handle the zeroth element of the sequence correctly, you could add 2 characters and change the code to return n<3?n>0:f(--n)+f(--n);

Haskell (26)
Surprisingly, this is only one character longer than the J solution.

f=(`take`s)
s=0:scanl(+)1s

I shave off a few characters by:

Using take as a binary operator;
Using scanl instead of the verbose zipWith.

It literally took me about half an hour to understand what is going on here, and the s is so elegant, I don't know how anyone would think of a solution like that! What I did not know is that you can use s again while defining s. (I'm still a beginner=)

GolfScript, 16 characters
~0 1@{.2$+}*;;]`

Example output:
$ ruby golfscript.rb ~/Code/golf/fib.gs <<< "12"
[0 1 1 2 3 5 8 13 21 34 55 89]

Here's a one-liner Python.  It uses floating-point, so there may be some n for which it is no longer accurate.
F=lambda n:' '.join('%d'%(((1+5**.5)/2)**i/5**.5+.5)for i in range(n))

F(n) returns a string containing the first n Fibonacci numbers separated by spaces.

I was thinking of doing this, but thought it would be too long. I didn't think about using flooring. Very nice.

Ah, Binet's formula. I also used it & it's accurate, at least till the 59th fibonacci number if you count 0 as the first. After that the numbers become too big & it starts using exponents.

70 chars, 1 line, to define function. + 4 +crlf to invoke.  Pretty good!

Perl, 50 characters
sub f{($a,$b,$c)=@_;$c--&&say($a)&&f($b,$a+$b,$c)}

Scala 71:
def f(c:Int,a:Int=0,b:Int=1):Unit={println(a);if(c>0)f(c-1,b,a+b)};f(9)

prints
0
1
1
2
3
5
8
13
21
34

Cool. I haven't even played with Scala yet. I will try it tonight at home.

Python(55)
a,b=0,1

for i in range(int(input())):a,b=b,a+b;print(b)

Perl, 29 28 bytes
perl -E'say$b+=$;=$b-$;for-pop..--$;' 8
1
1
2
3
5
8
13
21

Explanation
This is based on the classic $b += $a = $b-$a recurrence which works as follows:

At the start of each loop $a contains F(n-2) and $b contains F(n)
After $a = $b-$a $a contains F(n-1)
After $b += $a $b contains F(n+1)

The problem here is the initialization. The classical way is $b += $a = $b-$a || 1 but then the sequence goes 1 2 3 5 ...
By extending the fibonacci sequence to the left:
... 5 -3 2 -1 1 0 1 1 2 3 5 ...

you see that the proper starting point is $a = -1 and $b = 0. Initializing $a can be combined with setting up the loop
Finally replace $a by $; to get rid of the space before the for

I can give you a two line Python solution. This will return them as a list.
f = lambda n: 1 if n < 2 else f(n-1) + f(n-2)
g = lambda m: map(f, range(0,m))

print g(5)

You could have it print them out by adding another map to make them strings and then adding a join, but that just seems unnecessary to me.
Unfortunately I don't know how to put a recursive lambda into map, so I'm stuck at two lines.

What's it return for g(100)? ;)

@GigaWatt Heh, OP never said it had to be reasonable. Is the asymptotic running time something like O(n(1.62)^n)?

Here's one way you can (kind of) do this. Note that f(n) with n<=0 returns integers, and n>0 returns lists, so.. maybe it isn't ideal: f = lambda n: map(f, (-x for x in range(0, n))) if n > 0 else -n if n > -2 else f(n+1) + f(n+2)

By the way, you missed the first 0 in your answer. Changing f to return n if n < 2 is one workaround. :)

@DC I like your solution. Pretty creative. Yeah, I made mine start with 1, 1 because that's how I always learned it. I figured changing it was easy enough.

Python (78 chars)
I used Binet's formula to calculate the fibonacci numbers -

[(1+sqrt(5))^n-(1-sqrt(5)^n]/[(2^n)sqrt(5)]

It's not as small some of the other answers here, but boy it's fast
n=input()
i=1
x=5**0.5
while i<=n:
    print ((1+x)**i-(1-x)**i)/((2**i)*x)
    i+=1

Python (12 chars): print"11235" :)

You can shave 2 chars off by getting rid of the parentheses around 2**i. ** have higher precedence than *

The second term in binet's formula starts small and only gets smaller. You can leave it out completely and just round the result of the first term to the nearest integer instead (or add 0.5 and round down)

Scheme
This is optimized using tail-recursion:
(define (fib n)
  (let fib ([n n] [a 0] [b 1])
    (if (zero? n) (list a)
        (cons a (fib (- n 1) b (+ a b))))))

Haskell
fib n = take n f
f = 0:1:zipWith (+) f (tail f)

Proof that it works.

You can make it one function using where

J, 25 characters
I realise that J solutions are probably not what you're after, but here's one anyway. :-)
0 1(],+/&(_2&{.))@[&0~2-~

Usage:
    0 1(],+/&(_2&{.))@[&0~2-~ 6
0 1 1 2 3 5
    0 1(],+/&(_2&{.))@[&0~2-~ 10
0 1 1 2 3 5 8 13 21 34

How it works:
Starting from the right (because J programs are read from right to left),
2-~ 6 The ~ operator reverses the argument to the verb so this is the same as 6-2
Ignoring the section in brackets for now, 0 1(...)@[&0~ xtakes the verb in the brackets and executes it x times using the list 0 1 as its input - ~ again reverses the arguments here, giving x (...)@[&0 ] 0 1, meaning I can keep the input at the end of the function.
Within the brackets is a fork ],+/&(_2&{.) which is made up of three verbs - ], , and +/&(_2&{.).
A fork takes three verbs a b c and uses them like this: (x a y) b (x c y) where x and y are the arguments to the fork. The , is the centre verb in this fork and joins the results of x ] y and x +/&(_2&{.) y together.
] returns the left argument unaltered so x ] y evaluates to x.
+/&(_2&{.) takes the last two items from the given list (_2&{.) - in this case 0 1 - and then adds them together +/ (the &s just act as glue).
Once the verb has operated once the result is fed back in for the next run, generating the sequence.

TI-Basic, 43 characters
:1→Y:0→X
:For(N,1,N
:Disp X
:Y→Z
:X+Y→Y
:Z→X
:End

This code can be directly inserted into the main program, or made into a separate program that is referenced by the first.

This is the first TI-BASIC solution I've ever seen here that wasn't by me :) +1

Also, note for other people that newlines are not counted here because they can be removed.

I just got a TI-92 big-giant-qwerty-keyboard calculator.  Thanks for this one.

APL (33)
{⍎'⎕','←0,1',⍨'←A,+/¯2↑A'⍴⍨9×⍵-2}

Usage:
   {⍎'⎕','←0,1',⍨'←A,+/¯2↑A'⍴⍨9×⍵-2}7
0 1 1 2 3 5 8

Is the box character ⎕ part of APL or a missing-glyph?

@WarrenP: If you mean the 4th character from the left, that's called a 'quad' and it's supposed to look like that. There should be only one box.

FALSE, 28 bytes
0 1- 1 10[$][@@$@+$." "@1-]#

You can generate -1 using 1_ rather than 0 1 -

Powershell - 35 characters
Powershell accepts pipeline input, so I'm of the belief that the n | in n | <mycode> shouldn't be against my count, but instead is just a part of initiating a "function" in the language.
The first solution assumes we start at 0:
%{for($2=1;$_--){($2=($1+=$2)-$2)}}

The second solution assumes we can start at 1:
%{for($2=1;$_--){($1=($2+=$1)-$1)}}

Example invocation: 5 | %{for($2=1;$_--){($1=($2+=$1)-$1)}}
Yields:
1
1
2
3
5

Interestingly, attempts to avoid the overhead of the for() loop resulted in the same character count: %{$2=1;iex('($1=($2+=$1)-$1);'*$_)}.

Python, 43 chars
Here are three fundamentally different one-liners that don't use Binet's formula.
f=lambda n:reduce(lambda(r,a,b),c:(r+[b],a+b,a),'.'*n,([],1,0))[0]
f=lambda n:map(lambda x:x.append(x[-1]+x[-2])or x,[[0,1]]*n)[0]
def f(n):a=0;b=1;exec'print a;a,b=b,a+b;'*n

I've never abused reduce so badly.

+1 for reduce abuse

dc, 32 characters:
This will actually always show the two first 1's, so the function only work as expected for N >= 2.
?2-sn1df[dsa+plarln1-dsn0<q]dsqx

C, 75 characters:
Not as cool as the accepted answer, but shorter and way faster:
main(n,t,j,i){j=0,i=scanf("%d",&n);while(n--)t=i,i=j,printf("%d\n",j+=t);}

Extra:

CL, 64 characters:
One of my most used bookmarks this semester has an interesting example which is shorter than many some of the other ones here, and it's just a straight-forward invocation of the loop macro -- basically just one statement! Stripped it for all the whitespace I could:
(loop repeat n for x = 0 then y and y = 1 then(+ x y)collect y)

Quite short, and nice and readable! To read input, n  (including surrounding whitespaces) can be replaced with (read), adding 3 characters.

Does... does main take four arguments?

It takes as many as you give it. In this case it's just (ab)used to define a few variables that are used later :)

Python 2, 38 Bytes
An improvement on a previously posted solution:
a=b=1
exec'print a;a,b=b,a+b;'*input()

This uses exec and string multiplication to avoid loops.
Python 3, 46 Bytes
Not quite as efficient in Python 3:
a=b=1
exec('print(a);a,b=b,a+b;'*int(input()))

By switching to Python 2 you can save 9 bytes: Try It Online! You probably can add the Python 2 version to your answer.

@Stephen Good point! Updated.

Lua, 85 bytes
I am learning Lua so I would like to add this language to the pool.
function f(x)
    return (x<3) and 1 or f(x-1)+f(x-2)
end
for i=1,io.read() do
    print(f(i))
end

and the whole thing took 85 characters, with the parameter as a command line argument.
Another good point is that is easy to read.

C99, 58 characters
The following function fills an array of integers with the first n values from the Fibonacci sequence starting with 0.
void f(int*a,int n){for(int p=0,q=1;n--;q+=*a++)*a=p,p=q;}

Test harness, taking n as a command line argument:
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
     int n = (argc > 1) ? atoi(argv[1]) : 1;
     int a[n];
     f(a, n);
     for (int i = 0; i < n; ++i)
          printf("%d\n", a[i]);
}

Q 24
f:{{x,sum -2#x}/[x;0 1]}

First n fibonacci numbers

CoffeeScript, 48
f=(n,i=1,j=1)->(console.log i;f n-1,j,i+j)if n>0

65 in js:
function f(n,i,j){if(n>0)console.log(i),f(n-1,(j=j||1),(i||1)+j)}

PHP, 87
function f($n,$a=array(0,1)){echo' '.$a[0];$n>0?f(--$n,array($a[1],array_sum($a))):'';}

Uses array_sum and recursive function to generate series.
Eg:
 $ php5 fibo.php 9
 0 1 1 2 3 5 8 13 21 34

F#, 123
let f n = Seq.unfold(fun (i,j)->Some(i,(j,i+j)))(0,1)|>Seq.take n
f 5|>Seq.iter(fun x->printfn "%i" x)

Scala, 65 characters
(Seq(1,0)/:(3 to 9)){(s,_)=>s.take(2).sum+:s}.sorted map println

This prints, for example, the first 9 Fibonacci numbers. For a more useable version taking the sequence length from console input, 70 characters are required:
(Seq(1,0)/:(3 to readInt)){(s,_)=>s.take(2).sum+:s}.sorted map println

Beware the use of a Range limits this to Int values.

FALSE, 20 characters
^1@[1-$][@2ø+$.\9,]#

Input should be on the stack before running this.

Pyt, 3 bytes
ř⁻Ḟ

Try it online!

ř creates an array [1, 2, 3, ..., x]
⁻ decrements every item once (as Ḟ is 0 indexed)
Ḟ for every item in x converts it to it's fibonacci equivalent

x86 machine code - 379 bytes
The version with ELF headers scoring 484 bytes:
00000000: 7f45 4c46 0101 0100 0000 0000 0000 0000  .ELF............
00000010: 0200 0300 0100 0000 c080 0408 3400 0000  ............4...
00000020: 0000 0000 0000 0000 3400 2000 0200 2800  ........4. ...(.
00000030: 0000 0000 0100 0000 0000 0000 0080 0408  ................
00000040: 0000 0000 e401 0000 0010 0000 0500 0000  ................
00000050: 0010 0000 0100 0000 0000 0000 0090 0408  ................
00000060: 0000 0000 0000 0000 0000 1000 0600 0000  ................
00000070: 0010 0000 0000 0000 0000 0000 0000 0000  ................
00000080: 51b9 0090 0408 8801 31c0 ba01 0000 00eb  Q.......1.......
00000090: 0351 89c1 31c0 89c3 43b0 04cd 8031 c099  .Q..1...C....1..
000000a0: 4259 c300 0000 0000 0000 0000 0000 0000  BY..............
000000b0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000000c0: 31c0 9942 b903 9004 08c6 4101 0ac6 4102  1..B......A...A.
000000d0: 01c6 4103 013a 7103 0f84 ff00 0000 3a71  ..A..:q.......:q
000000e0: 0374 2680 4103 050f b641 036b c008 0041  .t&.A....A.k...A
000000f0: 048a 4104 e887 ffff ff80 6904 30c6 4103  ..A.......i.0.A.
00000100: 0183 e903 3a71 0375 da8a 4104 e86f ffff  ....:q.u..A..o..
00000110: ff3a 7106 0f84 ba00 0000 0fb6 4105 8841  .:q.........A..A
00000120: 060f b641 0788 4105 0fb6 4107 0041 06c6  ...A..A...A..A..
00000130: 4107 003a 7106 0f84 8800 0000 c641 0701  A..:q........A..
00000140: fe49 063a 7106 0f84 7800 0000 c641 0702  .I.:q...x....A..
00000150: fe49 063a 7106 0f84 6800 0000 c641 0703  .I.:q...h....A..
00000160: fe49 063a 7106 0f84 5800 0000 c641 0704  .I.:q...X....A..
00000170: fe49 063a 7106 744c c641 0705 fe49 063a  .I.:q.tL.A...I.:
00000180: 7106 7440 c641 0706 fe49 063a 7106 7434  q.t@.A...I.:q.t4
00000190: c641 0707 fe49 063a 7106 7428 c641 0708  .A...I.:q.t(.A..
000001a0: fe49 063a 7106 741c c641 0709 fe49 063a  .I.:q.t..A...I.:
000001b0: 7106 7410 fe41 08fe 4109 fe49 060f b641  q.t..A..A..I...A
000001c0: 0688 4107 c641 0601 83c1 033a 7106 0f85  ..A..A.....:q...
000001d0: 46ff ffff 3a71 030f 8501 ffff ffb3 0031  F...:q.........1
000001e0: c040 cd80                                .@..

Headerless version (that is the one to be graded):
00000000: 67c6 4101 0a67 c641 0201 67c6 4103 0167  g.A..g.A..g.A..g
00000010: 3a71 030f 842a 0167 3a71 0374 2e67 8041  :q...*.g:q.t.g.A
00000020: 0305 6667 0fb6 4103 666b c008 6700 4104  ..fg..A.fk..g.A.
00000030: 678a 4104 e80d 0167 8069 0430 67c6 4103  g.A....g.i.0g.A.
00000040: 0166 83e9 0367 3a71 0375 d267 8a41 04e8  .f...g:q.u.g.A..
00000050: f200 673a 7106 0f84 df00 6667 0fb6 4105  ..g:q.....fg..A.
00000060: 6788 4106 6667 0fb6 4107 6788 4105 6667  g.A.fg..A.g.A.fg
00000070: 0fb6 4107 6700 4106 67c6 4107 0067 3a71  ..A.g.A.g.A..g:q
00000080: 060f 84a3 0067 c641 0701 67fe 4906 673a  .....g.A..g.I.g:
00000090: 7106 0f84 9200 67c6 4107 0267 fe49 0667  q.....g.A..g.I.g
000000a0: 3a71 060f 8481 0067 c641 0703 67fe 4906  :q.....g.A..g.I.
000000b0: 673a 7106 0f84 7000 67c6 4107 0467 fe49  g:q...p.g.A..g.I
000000c0: 0667 3a71 0674 6167 c641 0705 67fe 4906  .g:q.tag.A..g.I.
000000d0: 673a 7106 7452 67c6 4107 0667 fe49 0667  g:q.tRg.A..g.I.g
000000e0: 3a71 0674 4367 c641 0707 67fe 4906 673a  :q.tCg.A..g.I.g:
000000f0: 7106 7434 67c6 4107 0867 fe49 0667 3a71  q.t4g.A..g.I.g:q
00000100: 0674 2567 c641 0709 67fe 4906 673a 7106  .t%g.A..g.I.g:q.
00000110: 7416 67fe 4108 67fe 4109 67fe 4906 6667  t.g.A.g.A.g.I.fg
00000120: 0fb6 4106 6788 4107 67c6 4106 0166 83c1  ..A.g.A.g.A..f..
00000130: 0367 3a71 060f 8521 ff67 3a71 030f 85d6  .g:q...!.g:q....
00000140: fe00 0000 6651 66b9 7801 0000 6788 0166  ....fQf.x...g..f
00000150: 31c0 66ba 0100 0000 eb05 6651 6689 c166  1.f.......fQf..f
00000160: 31c0 6689 c366 43b0 04cd 8066 31c0 6699  1.f..fC....f1.f.
00000170: 6642 6659 c300 0000 0000 00              fBfY.......

Calculates (possibly) \$ \infty \$ fibonacci numbers.

Japt -m, 4 3 bytes
Starts from 0.
MgU

Try it

x86 machine code - 23 bytes
08048060 <_start>:
 8048060:       6a 01                   push   0x1
 8048062:       59                      pop    ecx
 8048063:       6a 02                   push   0x2
 8048065:       5f                      pop    edi

08048066 <_start.loop>:
 8048066:       89 da                   mov    edx,ebx
 8048068:       89 c8                   mov    eax,ecx
 804806a:       01 d0                   add    eax,edx
 804806c:       89 c6                   mov    esi,eax
 804806e:       89 c3                   mov    ebx,eax
 8048070:       89 f0                   mov    eax,esi
 8048072:       89 c1                   mov    ecx,eax
 8048074:       47                      inc    edi
 8048075:       eb ef                   jmp    8048066 <_start.loop>

You can assembling and debug it using GDB, in debugger set a breakpoint at _start label (NASM style) and type s (mean single-step) command, see the output in register eax.
Output : 0 1 1 2 ...

I don't think this is a valid output format.

JavaScript (V8), 37 bytes
f=(n,i=0,j=1)=>--n?i+' '+f(n,j,i+j):i

Try it online!

Python 3, 45 bytes
f=lambda n,i=0,j=1:n and[i,*f(n-1,j,i+j)]or[]

Try it online!
A similar implementation to my JavaScript answer.

Neim, 3 bytes
f   # Fibonacci list
 I  # First line of input
   # Get first b elements of a

Try it online!

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/