text:
Output Pi without math
In as few bytes as possible, your job is to write a program that outputs:
3.14

In celebration of a late Pi day of course! :)
Rules
You can do it anyway you like, but there are some restrictions.

You may not use arithmetic operations anywhere in your program. This includes +, -, *, /, %, ^ (exponentiation), etc... This also includes incrementing (usually ++), decrementing (--), bitwise operations, and any built in functions that can be used as a replacement such as sum(), prod(), mod(), double(), pow(), sqrt(), inc(), dec(), etc... (Author's discretion)
The digits 3, 1, and 4 may not appear anywhere in your code.
You may not use any predefined variables/constants that your language may have as a replacement for 3, 1, and 4. (Author's discretion)
You may also not use any trigonometric functions such as sin(), cos(), tan(), arcsin(), arccos(), arctan(), sinh(), cosh(), tanh(), etc... (Author's discretion)
You may not use built-in or predefined values of Pi (or 3.14). No web requests.
Your program cannot require input of any kind (besides running it).
3.14 is the only thing that you may output, it cannot be part of some longer/larger output..

Winner
The answer with the least amount of bytes on April 18th wins. Good luck!
Looking forward to clever answers from clever minds! Malbolge anyone? :P

Ask questions in the comments if anything is unclear.

You may want to clarify that ^ is the exponentiation operator, not bitwise XOR operator.

Are bitwise operators allowed?

@ProgramFOX  Well, they can be used as a replacement for normal operations, so, no. Not allowed. I'll edit the post.

Web requests allowed?

@swish: I wouldn't use web requests, because that belongs to the list of Standard "loopholes" which are no longer funny

@swish I agree with ProgramFox. No web requests. I'll add it to the post.

Can I use - to indicate negative numbers like -2.0 ?

@user80551 yes you can

Somehow I think this would have been interesting with more digits (like 3.14159265 or whatever), because just 3.14 makes me sad.

@kukac67 Can you clarify No web requests?  I think the point is that information requested from the internet is not allowed.  To me web implies just http and https.  What about e.g. ftp?  What about this answer which sends an ICMP request, but does not require any response for it to work?

@DigitalTrauma The answer you linked to is fine. It's not really getting anything from the web. I just wanted to prevent linking to file on the web that contains 3.14 and outputting that.

too bad modulus counts as arithmetic, otherwise 9%5.86 (e.g. in bc) would have been unbeatable

Piet might almost count.  No visible arithmetic unless you decode it ;)

I expect a Perl one with only keywords (or maybe quoteless string literals). http://www.perlmonks.org/?node_id=290607

Even though I have more than 10 reputation, I cannot seem to add an answer.  I definitely think you should have allowed more digits.  credit for more digits offset against characters for the code.
Also, I think you should allow leading zeros
In octave:
datestr(581540,'mm.dd') (23 bytes) yields:
03.14

/me writes programming language where ⌘ outputs 3.14

Does the program have to have the same output no matter which day it runs?  For example, can I just output the current date in an M.dd format, and insist that you run my program on 14 March?

CJam - 8 6
S`,'.E

CJam is a new language I am developing, similar to GolfScript - http://sf.net/p/cjam.
Here is the explanation:
S is a variable preinitialized to space (" ")
` generates the string representation of the last value - which is exactly " " (3 characters)
, calculates the string length (3)
'. is the dot character
E is a variable preinitialized to 14; 3, 1 and 4 are not allowed but it doesn't say anything about 14 :)
Credits to Doorknob for the backtick idea

14 is a direct source of 1 and 4, so I wouldn't consider your use of the E constant valid.

@Brilliand I would accept the use of E.

But I will probably not choose this answer because it is a language that you are making, and it feels like cheating others...

@kukac67 While I haven't made an official release yet (coming today), I have already made the current CJam code available via hg. If you get the CJam code as of 1 day before you posted the question, it will run my program correctly (so I haven't made changes for solving this problem). But I won't really mind anyway.

time to develop HQ9+π...

@aditsu It wasn't because I thought you would have changed the CJam specification to help you in this question... But anyway, if this ends up being the shortest program (probably :D), I will choose it as the winner. I now realize there is no reason for CJam to be disqualified. I don't know what I was thinking... Hope you win! :)

You win! There was a 4-char answer, but I think it breaks the "no predefined values" rule by requiring the file-name to be 3.14. I really like that backtick thing btw.

Why isn't this the most voted answer?

@AnonymousPi Everybody is free to vote for the answers they choose. Maybe they're more impressed with other answers even if they're not as short.

Why do you have a variable preinitialized to 14?

@user2357112 to help with golfing :) I have variables for 10, 11, ..., 20 (A, B, ..., K)

PHP - 22 bytes
<?=date('n.j',8899e5);

Pi Day in year 1998 was really cool!

How is 8899e5 March 14th?

@kukac67: n.j is the format, and 8899e5 is the Unix timestamp of March 14th in 1998.

That is so clever.

You can save 7 characters by removing ,8899e5. It will be correct once a year.

Does not need that semicolon!

Actually you can make it a digit shorter by using this timestamp if I'm not mistaken: 623e4

@BrandonWamboldt Better a semicolon than a closing tag!

@Timo You're right, but it contains the illegal digit "3" ;).

@Blackhole Neither are needed, no semicolon and no closing tag is still a perfectly valid PHP file, give it a try :)

@BrandonWamboldt you are mistaken. Unless the final syntax character is a right brace (from a class or function definition, for example), either a semicolon or closing tag is required.

@Blackhole 20 bytes: <?=date('w.W',78e5); April 1, 1970 was a Wednesday in week 14.

C, 39
Assumes the machine is little-endian and uses IEEE floating-point standard.
main(){printf("%.2f",*(float*)"P@I@");}

The fun fact is that "P@I@" is actually not related to PI but is equivalent to 0x40494050 which is the representation of 3.144550323486328
http://ideone.com/uXVEtl

That's pretty awesome.

Your code assumes type-punning on a little-endian machine.

@NayukiMinase, yes you're right, it worth pointing it out. And it also assumes the use of IEEE floating-point standard.

And it contains undefined behavior (implicit declaration of variadic function)

This code actually assumes that the machine is Michael's machine :-).

As undefined behavior and comments like "it only works on full moon" or only working with one specific version of a really obscure compiler are sometimes acceptable at IOCCC, I guess it can also be acceptable here.

dc, 11 9 bytes
zE[.]znPp

z Push current stack depth (0) onto the stack
E Push E16 (==1410)
[.] Push the string "."
z Push current stack depth (3) onto the stack
n Pop 3 and print as number
P Pop "." and print as char
p Pop 14 and print as number with newline

Output:
$ dc <<< zE[.]znPp
3.14
$

So "use input base" is an operator?  It sort of smells like an arithmetic operation, but probably still valid.

@Brilliand There's nothing I see in the question that bans base conversions.  In fact the OP appears to be encouraging base conversions in a comment here http://codegolf.stackexchange.com/a/25681/11259

I do agree that it's valid; I'm just thinking that when the base conversion is an operator rather than part of the number syntax, it blurs the line between inline data and an arithmetic operation.

I think this should be 15 bytes?

@AdityaPatil Why? dc is a language and interpreter, just like all the other languages here.  dc -e  is just the invocation of that interpreter.  I could have just as easily saved the 9-byte program in a file and run dc pi.dc.  If these bytes need to be counted, then the same would have to apply to all other languages.  e.g. include python  in all python entries or ruby golfscript.rb  in all golfscript entries.  I believe the agreed convention here is not to include these, unless special options need to be passed.

JavaScript (ES5) 20 bytes
A variation of m.buettner's JS solution.
(x='.'+0xE).length+x

Edit: JavaScript (ES5) 18 bytes
A variation of ComFreek's idea of using the base64 decode function.
atob('Mw')+'.'+0xE

Edit: Javascript (ES5) 16 bytes
If the unary + operator is allowed to cast a string to a number, it can be reduced to:
+atob('MDMuMTQ')

WOW! That is really clever!

@NateEldredge This is string concatenation, not arithmetic.

is the use of + accepted here?

You can shorten this to 13 bytes using bitwise XOR: (5^6)+'.'+0xE

He explicitly stated that the use of +,-,x,/,= are not allowed...

@yentup based on the rules, it's not allowed to use bitwise operations

@nderscore oh ok I didn't catch that

MDN says the unary operator is an arithmetic operator: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators

@GeorgeReith Good point. I've updated my answer to point this out. It's not explicitly stated in the rules for this question, so I'll leave it for now.

@GeorgeReith Thanks for making me question my solution. Because of this, I just found a way to remove the need for the unary + operator and reduced the solution by 1 byte :)

I find the Javascript solution to be the most elegant and I was about to post mine until I noticed it had a '4' in it: atob('My4xNA=='), lol.

@MattBorja Yeah, that's why I had to add a non-printing character to the beginning to get rid of the 4 :)

The backspace may be unprintable, but it's still there. atob('CDMuMTQ').length gives 5.

@Dennis you're right, it's still there. It's even there if I copy+paste the result from console. I'm not happy with it so I'll revert to the 16 byte solution.

How 'about this one :) atob('MwAuMTQ') (15 bytes) or even atob('ADMuMTQ')

@MattBorja It's the same problem as my version using \b. It's not exactly the right output even if the extra char is not visible. Ex: atob('MwAuMTQ').length = 5

Haskell, 41 bytes
When is pi day in Australia?
p=(\(a:n:y:t:i:m:e:_)->[m,a,t,e])['.'..]

Edited to add: like the other Haskell answer, that outputs a string, so has quotes. You can score 33, and be strictly within the rules, but it's less fun:
p=putStr$map([','..]!!)[7,2,5,8]

Haha, wow. This is good!

Can you explain why this works?

I like this one a lot, +1. But I think technically ".." is invoking the increment operator, which was forbidden. (Actually upvoting also invokes an increment operation, so it should be forbidden as well;-)

I actually did think about that - I had an even shorter answer: p=[2.9,2.92..]!!([0,6..]!!2)...and in this one .. does look wrong. But Haskell is strongly typed, and the increment in the answer I gave is of Char not Num and isn't arithmetic-the thing that's actually banned. I'd need a fromEnum to convert the chars back to numbers to use them that way. Anyway, my conscience is clear :)

@yhager: ['.'..] is the char sequence "./0123456..." (etc). (a:n:y:t:i:m:e:_) is a pattern match pulling out the first 7 characters, [m,a,t,e] reorders 4 of them into "3.14". Knowing that this is what you want to do, it's a matter of searching the dictionary to find words with the right structure. Which I did...eg another pair was "ugliest suit". Then you come up with a joke :)

An Australian would say Pi Day is 22/7, not 3/14 ...

Morse Code, 33 Bytes
morse -d ...-- .-.-.- .---- ....-

Technically speaking, the information only takes 21 bytes.

We definitely need more golf solutions in morse code here...

Technically speaking, I'd say 21 bits, not bytes

@Michael since Morse code can be either a dot, dash, or space, wouldn't it require more than 1 bit to store 1 operation?

@smcg, you're right, each Morse unit stores a trit, so 21 Morse units is a little over 33 bits.

@smcg ButSpacesAreForWeakPeopleWhoCan'tReadThingsLikeThis

@ColeJohnson: But then spaces are part of the coding. E.g. ...... -> Is that III or SS or EEEEEE or EIS or IES or .... When I remember my time at the Marine, you even need long spaces and short spaces to differ between letters and words. So you always need two bits_2 per letter

As much as I like morse code (and hence this solution) - but isn't that against rule 3: "You may not use any predefined variables/constants that your language may have as a replacement for 3, 1, and 4." or even rule 2: "The digits 3, 1, and 4 may not appear anywhere in your code."?

@kratenko: I agree.

@phresnel You don't always need 2 bits, because we only need 3 values. Suppose dot, dash, space are 00, 01, 10 respectively. Since 11 is never used, we can safely replace one of these with a single 1 bit without causing any ambiguity. If we use the single bit for the most common value (dot), the information can be stored in 37 bits.

@nmclean: Hmm, yeah, and long spaces for word separation can be replaced by two consecutive short spaces. I thought about a variable length encoding, too.

@phresnel 10 is a long space in this case. No need to encode short spaces at all since dot and dash are already distinct.

@nmclean: Hmm, yeah. I dunno what made me that high. It's a total facepalm.

One could define a subset of Morse Code that only contains the characters necessary to send the message.
In this case, the message is "3.14", so two bits could suffice:
.. = "3"
.- = "."
-. = "1"
-- = "4"
Spaces are not even necessary.
Thus, the message is sent in 8 bits, "...--.--".
Represented as a byte, the message is now 0x1B or 0xE4 depending on bit polarity.

@KenA Or you could define “3.14 Code”, where the only valid message is an empty one (0 bits) and the output is always “3.14”. But doing things like these is not interesting.

@phresnel Or you can use ternary and store a Morse code character in log_2(3) bits (1.58496...). Then, if you want to store 1000 characters, you don't need 2000 bits, but only 1585. If you want to find a modern ternary computer.

@svick Have you ever heard of Golfscript :P

@ColeJohnson: Interesting :D

J - 15 11 10 char
Made it shorter, using the fantastic i:.
6{i:6.28j8

Explained:

6.28j8 - The complex number 6.28 + 8i.
i: - This is where the magic happens. i: on a complex number A+Bi, B≠0 takes B+1 equally spaced points from the interval [-A,A].
6{ - Take element at index 6, which just so happens to be 3.14.

Previously, we had the following nonsense:
|.'.'2}":22b8d5

Explained by explosion:
         22b8d5  NB. 8d5 in base 22 = 4163
       ":        NB. convert to string
  '.'2}          NB. change character at index 2 to '.'
|.               NB. reverse to make '3.14'

Instead of |.'.'2}":22b8d5, you can save 2 characters by picking a number that doesn't require reversal: '.'1}":16bbc6

@epicwisdom The digits 3, 1, and 4 are banned. I have to use a number in the form 41X3 because I am only allowed to modify the characters at indices 0 and 2.

Linux command line, 35 bytes
This one is nowhere near winning, but here it is for the fun of it:
ping -w2 67502862|grep -oP '.\..\d'

Output (after 2 seconds):
$ ping -w2 67502862|grep -oP '.\..\d'
3.14
$

Quote from the question: "No web requests."

@Doorknob ICMP echo request != web request.  Regardless, the ping is to 4.6.3.14, from which I get no reply, so its not like I'm getting any useful information back from the internet

@Doorknob But if this still bothers you, we can do this :;ping -t${#?} -qc2 67502862|grep -oP '.\..\d'.  This sets the TTL to 1, so the outgoing ICMP echo is dropped by your router before it ever gets anywhere near the internet

You can save 9 s by using ping -w2 67502862. (Ninja edit because before i was advising w1, almost broke the rules.)

@lolesque Thanks.  Doesn't improve the golf score though ;-)

GolfScript, 18 13 12
'.'.`,\.,n`,

Old version:
'...','.'.,'....',

It's very artistic, only 3 unique characters! ;)
How it works:
# cmd   # stack
'...',  # 3
'.'.    # 3 '.' '.'
,       # 3 '.' 1
'....', # 3 '.' 1 4

Here's an explanation of the 12-char version (much more interesting, IMO):
'.' # '.'
.`, # '.' 3
\.  # 3 '.' '.'
,   # 3 '.' 1
n`, # 3 '.' 1 4

It works because n`, is 4, since n` is '"\n"'. Same logic for '.'`,. It also swaps instead of creating a new string to save a char (thanks @algorithmshark).
Alternate version:
'pi ','.'.,'day!',

or
'Hi ','.'.,'PPCG',

Or anything in those strings, really. :P

Only 3 different characters, cool :)

Would '.'.`,\.,n`, work to save a char? Reusing the '.' by duplicating and swapping.

@algorithmshark Yep, thanks!

This is very clever! +1

this does look like the morse code version

OP's answer.
Mathematica, 21 20 18
This feels cheap...
Range[2,5,.06][[20]]

or
Range[2,5,.02][[58]]

Figured out how to make it 18:
Range[-.86,5][[5]]

Haskell, 49 48 12
(48 includes the new line character)
p=[-6..]
r=concat$show(p!!9):".":(show$p!!20):[]

Run it by calling the r function.
Using the method as with Mathematica above, you can type this into GHCi:
[-2.86..]!!6

Java, 87 86
class P{public static void main(String[]a){System.out.print("tri".length()+"."+0xe);}}

Scala, 27
Translated from Java as suggested by Score_Under. (I don't really know Scala)
print("tri".length+"."+0xe)

Oh, 0xe is clever. Do you mind if I improve my JS answer with that? ;)

Most java can be directly converted to scala, which is usually shorter if you really want to save on the bytes - if you're using it as a script, the entire thing is just: print("tri".length+"."+0xe)

Yeah I thought of the same thing, which is shorter in Julia as  [-.86:5][5] for 11, but figured it didn't count since ranges are just math.

Bash, 50
Help/error messages aren't external resources, they're a command's output!
If anything is rule abuse, this is it. It uses the coincidence that the help message given to STDERR by the exact command
ping6

is 314 characters long (at least on Ubuntu 13.10 with iputils-121221). EDIT: I appreciate that this is much less portable than I expected...
m=`ping6|&wc -c`
false
o=$?
echo ${m:0:o}.${m:o:2}

The first line takes the character length of the help message and stores it in a variable.
As in my other answers, the next few lines obtain the number 1 by taking the exit status of false (not very portable but this is code-golf after all!), then use that value to insert a decimal point in the last line
Output: 3.14

you sir are genius

Uh oh, "2.81" on Ubuntu 12.04 (iputils-101006).  +1 all the same ;-)

@DigitalTrauma according to info ping6 I have iputils-121221

also check out my chmod-abusing answer to this question at http://codegolf.stackexchange.com/a/25724/16402

How about ping6|&wc -c|sed 's/^./&./'?

@gniourf_gniourf I have no idea how to use sed... thanks

even shorter: ping6|&wc -c|sed 's/./&./'

Bash+TeX 28 bytes
If you have TeX installed:
tex -v|head -c8|cut -d\  -f2

The version number of TeX asymptotically approaches pi as the software improves. So, as time goes on, you can use this (nonconforming) implementation to print more and more digits!
tex -v|cut -d\  -f2 | head -n1

This printed 3.1415926 back in 2011; as of January 2014, it will print 3.14159265.

I love this one!

You can use tex -v|grep -oP '.\..\d' to save 4 bytes. (Regex stolen from DigitalTrauma's answer.) Anyway, +1 because I just thought of the same answer.

GNU date, 17 bytes
date -d2/5 +%u.%y

This one only guaranteed to work this year, but I don't see any limitation in the rules about this ;-)
The + is simply indicates the start of the format specifier for date and is not an arithmetic addition.  Same with the -, indicating input date.
Output:
$ date -d2/5 +%u.%y
3.14
$

only guaranteed to work this year It's fine.. :)

Bash, 17 bytes
tr 0 .<<<$[62#MC]

Dash, 41 bytes
perl -pechomp,s/./$./<<$

..

.

Bash would complain loudly about the missing ending marker while Dash doesn't, so a Bash solution without error messages would require two extra bytes.

+1 as well.  I guess @TheDoctor forgot to click the upvote button?

@DigitalTrauma oops... fixed

JavaScript, 20 bytes
'...'.length+'.'+0xe

Use it in a console, so that the result is directly printed. Otherwise, alert(...) will add another 7 characters.
Same as my other answer, I just noticed it's a lot shorter in JS.
The idea of using 0xe for 14 is taken from the OP's submission with the OP's kind permission.

Its fine, you can use it :)

Alternative 20 byte solution: (x='.'+0xE).length+x

@nderscore that's a pretty neat idea. If you post that as another answer, you'll get my upovote ;)

Bash 23 22
seq 2 .02 5|sed -n 58p

Shell (without history expansion) 20
seq 2 .02 5|sed 58!d

seq 2 .06 5|sed -n 20p also works as given in OP's Mathematica answer.

sed 58!d is slightly shorter.

@Dennis Weird, gnome-terminal substitutes !d with dpkg ... which was the last command that I ran that began with d. Works fine in ksh but zsh says zsh: event not found: d so that's definitely getting substituted for something.

That's because of Bash's  history expansion. It's disabled by default for scripts, so if you save the same command in pi.sh and execute bash pi.sh, it will work fine.

@user80551 Thanks for the tip on Aviation about the Chat GPT post - both of that user's "contributions" pegged the detector, so we've addressed that. Much appreciate the good catch there. Cheers!

Python, 39 or 28 47 or 34
(Thank you Score_Under for golfing it down so much)
print"%s.%s%c"%(len('aaa'),len('a'),52)

+ here is the string concatenation operator, not addition.
Copying the 0xe trick from the OP, here's 28 chars with help from @psal
print('%X.%s'%(675,0xE))[2:]

Old versions:
print str(len('aaa'))+'.'+str(len('a'))+chr(52)

print str(len('aaa'))+'.'+str(0xe)

print"%s.%s"%(len('aaa'),0xe)

The second one can be shortened by removing the space after the print and using a "%s" format instead of str(). c.f. print"%s.%s"%(len('aaa'),0xe) at 29 bytes. You can do the same to the first one too: print"%s.%s%c"%(len('aaa'),len('a'),52) at 39 bytes.

@Score_Under Oh, I thought using %s still requires str. Thanks for the tip :)

another 29 bytes solution : print('%s,%s'%(0xE9,0xE))[2:]

... and in 28 bytes : print('%X.%s'%(675,0xE))[2:]

GolfScript, 8 bytes
'??.'(\(

This program contains non-printable ASCII characters, so it cannot be directly pasted here.  Instead, the question marks in the code above should be replaced with the bytes 03 and 0E in hexadecimal.
For convenience, here's a hex dump of the actual program.  Unix / Linux users can run this hex dump through xxd -r to reconstruct the program:
0000000: 2703 0e2e 2728 5c28                      '...'(\(

Explanation:

The first five bytes of the program form a single-quoted string literal encoding the three characters with the ASCII codes 3, 14 and 46 (= ASCII period).
( chops the first character off the string and pushes its ASCII code (3) on the stack.  \ swaps the top two items on the stack, pulling the string back to the top, and the second ( chops another character off the string, again pushing its ASCII code (14) on the stack.

At the end of the program, the stack (excluding the empty input string) therefore looks like this:
3 "." 14

At the end of the program, the default behavior of the GolfScript interpreter is to stringify and print everything on the stack, yielding the desired output.

Snap! I had exactly the same idea, just 12 hours too late. I guess I should read page 2 before posting... Oh well, rolling back, +1 to you.

bash -- 39
We all know that the first few digits of Pi can be computed from the following statement:

May I have a large container of coffee

We need only 2 decimal places, right?
m=May
i=I
h=have
echo ${#m}.${#i}${#h}

Perl, 15 20 bytes
print 05706=~s/0/./r
print 0xbc6=~s/0/./r

Isn't PI__ something of a constant related to Pi?

It's not a constant. It's two strings being XOR-ed.

Bitwise operators aren't allowed.

Oh, they're not. Well, there goes my hypothetical solution. That said, if bitwise operators aren't allowed, is there even much else to do than count lengths of strings?

There are several answers that use numbers in different bases.

You could use say instead of print.

Yeah, but use feature 'say' adds a lot more bytes.

You could explicitly state that you're using Perl 6.

Mathematica - 78
DateList["March"<>ToString@FromDigits@"E"]~DateString~{"MonthShort",".","Day"}

In the spirit of Pi Day! :D

tr + Bash, 17 bytes
tr a-j 0-9<<<d.be

The - chars here are not arithmetic subtraction operators.  They indicate range.
Output:
$ tr a-j 0-9<<<d.be
3.14
$

Clever, although a character translation is really hidden arithmetics.

@ArlaudPierre True, though I would contend that pretty much all solutions here have hidden arithmetic one way or another.  If you look at the actual machine instructions executed for any of these answers, I would think all have some bitwise or arithmetic instructions, which are banned from explicit use by the question.

@ArlaudPierre The question requires the string "3.14" to be output.  Regardless of the language, somewhere under the hood, this will degenerate to a write() call or similar.  There will necessarily be some arithmetic under the covers to ensure the correct number of bytes is written, if nowhere else.  I think the point of the question is to hide the necessary arithmetic/bitwise computations.

BASH, 57
This is longer than most answers, but there is nothing bad in trying.
f=`echo aaaaaaaaaaaaa|wc -c`;e=`echo aa|wc -c`;echo $e.$f

gives
3.14

Sorry for re-golfing everyone's answers :P, In the same vein as this I found: c=wc\ -c;echo \$c<<<..`.`$c<<<''``$c<<<...``

C, 36
main(){printf("%d\b.%o\b",' ','`');}

If we combine it with my answer, we can save 2 bytes to get a score of 34 : main(){printf("%d\b.%d",' ',0xe);}

JavaScript - 23 bytes
atob('Mw')+atob('LjE0')

Thanks to nderscore (see his comments)!

Nice :D I didn't even know about this

It contains 4 though ;)

@nderscore Ah! You're right! Would btoa() work to get 3.14 somehow?

@kukac67 The base64 character set doesn't contain a period :(

@nderscore Oh, that's too bad. The ascii codes for '4' also include '4' :( Let me think of other solutions...

atob('IDMuMTQ=') if the asker allows a leading space, atob('IDMuMTQ=').substring(1), if they do not. EDIT: Doh! a 1! atob("ICAzLjE0").substring(2).

@acbabis slice is shorter than substring: atob('IDMuMTQ=').slice(1)

@nderscore Neat

23 byte "legal" version: atob('Mw')+atob('LjE0') and 14 byte "illegal" version: atob("My4xNA")

@nderscore Thanks for the suggestion. I've just found atob('Mw')+'.'+0xE, however, I also just saw your edit ;) I'm not sure whether I may incorporate your comment into my answer.

Go ahead, it was your idea originally :)

No + allowed, if I interpret the rules correctly :(

@acbabis No arithmetic operations (e.g. using '+') are allowed, however, '+' represents string concatenation in this case.

Aight, just making sure.

GolfScript, 13 10
{xy}.*'.'\

Thanks to Ilmari Karonen for the improved version!
x and y are non-printable characters (see http://www.asciitable.com/ for more info), respectively ETX and SO, which decode to 3 and 14.
What this code does should be pretty clear.
Note: The following rule
You may not use any predefined variables/constants that your language may have as a replacement for 3, 1, and 4. (Author's discretion)
is not broken, since ASCII characters are neither variables, nor constants.

The digits 3, 1, and 4 may not appear anywhere in your code. , Your program cannot require input of any kind (besides running it).

The digits do not appear anywhere. There's no input.

And your final code is...?

{}.*.{}.*, and inside the brackets there are 2 non-printable characters, respectively (http://www.asciitable.com/) ETX and SO

Oh, I think it's ok then but you should rephrase the answer to mention ETX and SO instead of just 3 and 14 in ASCII which can be ambiguous.

Yeah, you're right. Better now?

You could shorten this to {xy}.*'.'\  (10 chars). Mine's still shorter, though. ;-) But +1 for teaching me about { }.* (and { }.%), I'll have to keep that trick in mind.

Brilliant! :D Thank you :)

C#
 ((int)'ĺ').ToString("#\\.##");

ĺ is character 314, not a pre-defined variable or constant.
the .ToString formats the output into a digit, a period, and then 2 more digits.

Nice, but it currently doesn't output, and it's not compilable.

Console.Write(((int)'ĺ').ToString("#\.##"));

New to the site and can't write comments yet, so I'll post it here. Just wondering about this Javascript solution:
'...'.length+'.'+0xe

and this rule:
3.14 is the only thing that you may output, it cannot be part of some longer/larger output..
If I run this code in my browser console, I get:
"3.14"

or using Node at the command line:
'3.14'

but if I run this code:
parseFloat('...'.length+'.'+0xe)

I get:
3.14

Using Node.js to run a .js file, I can write:
console.log('...'.length+'.'+0xe)

and get:
3.14

There was never a limitation on what type the resulting value can be. So, string or number doesn't matter. The quotes around the string are not considered part of the output.

Welcome to CodeGolf and Programming Puzzles @RobertMunn! This answer is valid as it obeys all the rules... Bear in mind that console tends to wrap strings in quotes when displaying them...  You have used + but not arithmetically, it's being used as a concatenator, so that's valid... Also you could have made this smaller using alert rather than console.log... But otherwise, great effort. We hope you like it here...

That's pretty nice! You should consider adding the name of the language and byte count (e.g. Javascript, 20)

Thanks Ace, I'm just learning the rules here. I couldn't leave a comment so I posted separately, I guess this was more of a clarification on the rules kind of post, which nderscore and WallyWest clarified for me. I appreciate everyone's patience with a newb.

Python, 49
a=str(range(298,500,2)[8]);print a[0]+'.'+a[5<6:]

Explanation

range(298,500,2)[8]-Clever way to get 314
a=str(314) - '314'
a[0]-3
5<6-Shorter than True which means 1
a[5<6:] - a[1:] - '14'
print a[0]+'.'+a[5<6:] - Putting the . and printing. The +s are string-concatenators.

Python (abusing the rules unless OP abuses their discretion)52 43
from cmath import*
print round(phase(-2),2)

Title:"Output Pi without math". First line:from cmath import :P.

@Blackhole But it's not an explicit bullet-point in the rules.

Yeah... phase disqualifies this.

@kukac67 Is the other answer acceptable?

If it were valid, though, -2+0j would save 6 characters.

@minitech Even shorter

@user80551 Yes the other answer is valid, I used ranges myself in my Mathematica answer. :)

Pure bash, 22 bytes
a=.$[0xE];echo ${#a}$a

Output:
$ a=.$[0xE];echo ${#a}$a
3.14
$

$[0xE] is just a base conversion with no actual arithmetic explicitly performed, so I assume this is legal.

Perl, 22 bytes
print pack N,858665268

BF,45 chars(without \n)
How About BF
 >+++++++[<+++++++>-]<++.
 >++[<-->-]<-.
 +++.+++.

thanks for pointing out that it only needs 3.14

Hm... aren't all those + and - signs incrementing and decrementing?

Yeah, it's impossible to write a nontrivial BF program that satisfies the guidelines.

I think that outputs 3.41592 rather than just 3.14 as required... (bf interpreter on Ubuntu 13.10)

You can write ++++++++++[>+++++<-]>+.-----.+++.+++. and save 8 chars :P

Bash, 53 (using seq)
Does seq count as arithmetic?
Reuses bits of my other answer. Based on string length - it generates a string which is 314 characters long.
m=`seq -8 99|wc -c`
false
o=$?
echo ${m:0:o}.${m:o:2}

Line 1 generates a sequence of integers between -8 and 99 using seq and sends the result to wc -c which counts the number of bytes in its input. The result is stored in m.
After this point, it's the same as my other answer:
m should now be 314. Now I want to insert a decimal point after the first character... but I'd need the digit 1 to do that!
Lines 3 and 4 circumvent that by taking the exit status of false and storing it in a variable. The exit status of false isn't 1 on some systems, so this isn't very portable, but this is code-golf after all!
Line 5 concatenates the first character of m, a decimal point and the next two characters of m, and prints the result to standard output.
Output: 3.14.

There is a much shorter answer using seq http://codegolf.stackexchange.com/a/25732/8766

PowerShell - 47 24 20
Update: after seeing @grax's answer, use a single [char], and use format string.
'{0:#\.##}'-f+"ĺ"[0]

Mathematica, 56 bytes
(l=ToString@StringLength@#&)@"..."<>"."<>l@"."<>l@"...."

Not much to say. I'm generating the digits as string lengths and concatenate them.

JavaScript, 22
Just a modification of ComFreek's idea
atob(atob('TXk0eE5B'))

JavaScript, 150
A different way just for fun
while(!m||a[0]>=(0+a)[a.length]){a=(Math.random()+"").replace(/(.)(.)(.*)(.)(..)/,"$2.$5");
m=a.match(/([^0-25-9]).[^02-9][^0-25-9]/)}m[0]

The idea was to get a random numbers until it is the desired one. Challenge was not to use the forbidden digits :) The two regexes should be possible to combine into one but I'm too tired now :)

Matlab - 39 characters with a bit of magic
39 characters:
x=magic(6);fprintf('%d.%d\n',x([2,29]))

output:
3.14

magic(6) produces a magic square of size 6x6. It happens to provide the same square every time, which allows us to cherry-pick numbers. Matlab R2011b is used here.

Bash, 72
I would use base64... if the digit 4 didn't appear in it!!
I might have used tr but that's already been done...
So instead I'm going to misuse chmod, which is by no means the shortest solution. What this script does is set its own permissions to the octal mode 314, then insert a decimal point.
chmod u=wx,o=r,g=x $0
m=`stat -c%a $0`
false
o=$?
echo ${m:0:o}.${m:o:2}

The first line sets the script file's permissions to the equivalent of octal mode 314 (--wx--xr--).
The second line uses stat and its --format option (shortened to -c) to get the file's octal mode only, represented by %a. The result is saved to a variable m.
After the second line, m should be 314. Now I want to insert a decimal point after the first character... but I'd need the digit 1 to do that!
Lines 3 and 4 circumvent that by taking the exit status of false and storing it in a variable. The exit status of false isn't 1 on some systems, so this isn't very portable, but this is code-golf after all!
Line 5 concatenates the first character of m, a decimal point and the next two characters of m, and prints the result to standard output.
Output: 3.14.

This is just pure evil.

Ruby - 78
Long one, but it can be easily extended to print more digits.
a="How I wish".split(' ')
print "#{a.shift.length}."
a.each{|w|print w.length}

And the output: 3.14
Longer(194) version for more digits:
a="How I wish I could enumerate pi easily since all these bullshit mnemonics prevent recalling any of the sequence more simply".split(' ')
print "#{a.shift.length}."
a.each{|w|print w.length}

and output: 3.14159265358979323846.

+1 Did you figure out the longer version all by yourself without using any program?

It's from wiki - http://en.wikipedia.org/wiki/Piphilology :)

PHP (30 bytes)
Longer than most here, but uses only very dirty tricks:
<?=ceil(2.5).'.'.(!0).chr(52);

Another version (29 bytes), if error reporting is disabled, otherwise outputs a notice:
<?=ceil(2.5).'.'.hexdec(E);?>

C, 58
main(){printf("%d.%d%c",(int)ceil(2.9),(int)ceil(.8),52);}

C, 43
With a little cheating. Constants for 14 were not forbidden.
main(){printf("%d.%d",(int)ceil(2.9),0xe);}

VB.NET - 0
After failing to write anything under 16 bytes, I decided to just make a joke answer. A PictureBox holds a saved screenshot of the "3.14" from the original post, instead of actual digits, so if you're looking for output in text format, I have failed.
But hey, I didn't have to write any code at all! And technically it shows exactly what the original post says to output...

I think if you check the source of Form1.designer.vb you will see 3.14 in your code.

No, there is no 3.14 in the designer code. I can tweak the size and location of the form and picturebox so that there are no 3's, no 1's, and no 4's in the designer code. But of course, if you count the designer code, it's a whole lot more than 0 bytes. I was merely joking that I could display 3.14 in a program without writing a single line of code myself.

Ah I'm stupid for not reading that it was a picture box.

Oracle SQL,56
select to_char(to_date('70907','YMMDD'),'Q.WD')from dual

Output:
3.14

BASH
Not the shortest of the bunch, but it doesn't contain any numbers so I thought it was kind of cool:
29 bytes
wc<<<'a

'|sed 's/ /./;s/ //'

Output:
3.14

Java, 65
System.out.println("abc".length()+"."+"abcdefghijklmn".length());

clever!

You could cut this down a bit more: new int[3].length+"."+new int[14].length

How'z it getting 65??
I am not getting this!!

@elimirks I cant as its mentioned in wuestion that I cannot use '1','3' and '4'

C++, 214 202
Only works for little-endian processors... Big-endian version would be shorter.
#include<algorithm>
#include<iostream>
#include<iterator>
union u{int i;char c[];};struct s{u a,b;};int main(){s x;x.a.i=858665268;std::reverse_copy(x.a.c,x.b.c,std::ostream_iterator<char>(std::cout));}

JavaScript - 46 43
Not very original, but who cares :)
(a="a+b").length+(b=".")+b.length+(a+b).length

And after some help from nderscore:
(a="a+b")[L="length"]+(b=".")+b[L]+(a+b)[L]

(Note: all occurrences of + are string concatenations).

You could save 3 bytes by caching the name of the length property: (a="a+b")[L="length"]+(b=".")+b[L]+(a+b)[L]

Cool, didn't know that trick. Thanks @nderscore!

Java, 106 95
class A{public static void main(String[]a){System.out.print((""+(int)'ཊ').replace('9','.'));}}

You can shorten this by 10: class A{public static void main(String[]a){System.out.print((""+(int)'ཊ').replace('9','.'));}}

ksh 19
echo ${#0}.$((0xe))
3.14

Brainfuck - 39
++++++++++[>+++++<-]>+.-----.+++.+++.

Note that + and - are not arithmetic operators.

+ and - increment and decrement.

Hmm, you have a point there. I didn't think of that when writing the answer.

PHP, 22
<?=ceil(M_E),'.',0xE?>
3,1,4 does not appear in the code and M_E is none of them
Perl, 29
printf "%d.%d",(-2..5)[5],0xE
Perl, 25
print((-2..5)[5],".",0xE)
Awk 54
END{split(systime(),a,"");printf a[2]"."a[7-6]"%c",52}
Awk (Bonus)
END{O=""=="";X=O""O;X+=O+=O+O;print O"."X;}
I know it uses arithmetics but at least there are no numbers at all! XOXOXOX

APL (with lambdas), 21 character (byte count depend on encoding)
APL capable font needed to see this.
{⍴⍵,⍎⍵}'⍞←⌽".",⍕⍴⍕⍳2'

Here explained
{⍴⍵,⍎⍵}'⍞←⌽".",⍕⍴⍕⍳2'
⍴'⍞←⌽".",⍕⍴⍕⍳2',⍎'⍞←⌽".",⍕⍴⍕⍳2' # lambda applied
⍴'⍞←⌽".",⍕⍴⍕⍳2',⍞←⌽".",⍕⍴⍕⍳2    # string is being evaluated as expression
⍴'⍞←⌽".",⍕⍴⍕⍳2',⍞←⌽".",⍕⍴⍕1 2   # ⍳2 expanded to 1 2
⍴'⍞←⌽".",⍕⍴⍕⍳2',⍞←⌽".",⍕⍴'1 2'  # 1 2 stringized
⍴'⍞←⌽".",⍕⍴⍕⍳2',⍞←⌽".",⍕3       # got dimension of '1 2'
⍴'⍞←⌽".",⍕⍴⍕⍳2',⍞←⌽".",'3'      # 3 stringized
⍴'⍞←⌽".",⍕⍴⍕⍳2',⍞←⌽'.3'         # '.' and '3' concatenated
⍴'⍞←⌽".",⍕⍴⍕⍳2',⍞←'3.'          # '.3' reversed
⍴'⍞←⌽".",⍕⍴⍕⍳2','3.'            # '3.' printed
⍴'⍞←⌽".",⍕⍴⍕⍳23.'               # '⍞←⌽".",⍕⍴⍕⍳2' and '3.' concatenated
14                              # got dimension of '⍞←⌽".",⍕⍴⍕⍳23.'
                                # finally, '14' printed

PowerShell, 19 bytes
+''[0],0xe-join'.'

The third character is the non-printable control char ETX, ascii code 3. Hex dump:
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00000000  2B 27 03 27 5B 30 5D 2C 30 78 65 2D 6A 6F 69 6E  +'.'[0],0xe-join
00000010  27 2E 27                                         '.'

This feels like cheating. I did have to use a '3' after all in the hex editor. Personally, I don't think an answer requiring the use of a hex editor should be allowed. If your language supports escaping non-printable chars, fine, but if it can't be copy/pasted from here, I don't think it should be allowed, JMO.

PowerShell, 20 bytes
+'ಎ'[0]-replace2,'.'

PowerShell, 21 bytes
(5..2)[2],0xe-join'.'

PowerShell, 22 bytes
(-6..20)[9,20]-join'.'

Array from -6 to 20
Indexes 9 and 20 grab 3 and 14
Join on dot (.)

PowerShell, 24 bytes
[int]'ಎ'[0]-replace2,'.'

'ಎ' is a string with the unicode char 3214
'ಎ'[0] gets the char
[int]'ಎ'[0] casts to an int with value 3214
-replace converts 3214 to a string and swaps the 2 for a dot (.)

C 71
int main(){printf("%d.%d%d",strlen("***"),strlen("*"),strlen("****"));}

Java 41 / 83 characters
System.out.println((int)''+"."+(int)'');

Unfortunately copy pasting directly into the IDE from here might not work. The characters inside the '' don't show correctly here, but they are essentially variations on the space ASCII character with the decimal values 3 and 14. Below a full compilable version;
class C{public static void main(String[]a){System.out.println((int)''+"."+(int)'');}}

Python 3, 45 bytes
a=str(ord("ĺ"))
print("%s.%s"%(a[0],a[True:]))

(Had to use True to get around the restriction on the digit 1...)

You can use 5<6 or any other Boolean operandi instead of True. (Yes the 5<6 was shamelessly stolen from the other Python answer)

Python 2, 40
Doesn't bend the rules at all.
print('%i\b.%i'%(ord(' '),ord('î'))[:-1]

Extended ASCII ftw. Shame I couldn't put \b at the end of my string and remove the ()[:-1]...
~-~!, also 40
'=~~,~~~~~,~~~~~:@'+~:@'-~~~~:@'-~:@'+~~

Object disoriented - 72 characters
dmain.ozozososozozososozozosozosososozozozososozozozosozozososozosozozzz

Boring answer, but the most compact I've achieved.

T-SQL, 36
This entry assumes CHECKSUM() is allowed.
PRINT STUFF(CHECKSUM('2~2'),2,2,'.')

Try the SELECT version in SQL Server 2012 here.

TinyMUSH, 16
This entry assumes decrypt() is allowed.
\decrypt(A<?B,.)

Tcl, 28
puts [scan ^C %c].[scan ^N %c]

^C and ^N are one byte. Each one is obtained by pressing Alt+03 and Alt+014. They correspond to ASCII control chars ♥ and ♫

JavaScript, 32 bytes
'３.１４'.normalize('NFKD')

Not sure if it is valid, and it also not the shortest. But post this just for fun since did not find a similar one.

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


text:
Generate ASCII art from text
Your challenge is to write a program which creates ASCII art from an input string, like FIGlet or the Unix banner utility.
Specifically, your program should take as input a string consisting of printable ASCII characters, and output an ASCII art representation of those characters in the order they appear in the input.
You're free to choose the details of what the output will look like, except that:

The output must be readable.
Simply representing each input character by itself in the output, with or without surrounding "decorative" characters, is considered cheating.

Also, you may not use any programs (like FIGlet), libraries or built-in tools designed for generating ASCII art, nor may your program rely on any external resources such as web services.
This is code golf, so the shortest program wins.

Here's my golfscript program, assuming input from command line:. Input whatever string you like, and the program will output ascii art.

@TonyH: I don't think it's a duplicate; this challenge seems to basically amount to "golf a simple FIGlet clone", while the challenge you linked to is about converting bitmap images to ASCII art. I do feel that this question is somewhat underspecified, though.

@user3103241: I've edited your challenge to hopefully make it a bit clearer, more specific and less open to abuse.  Let me know if you feel I've misrepresented the intent of your challenge.

I'm not sure why this was put on hold, when e.g. Generating PBM bitmap files from ASCII text (a very similar challenge, but asking for bitmap output instead of ASCII art) and ASCII art “Hello-World!” (similar, but with fixed input and some restrictions on output characters) seem to have been perfectly fine and successful challenges. Voting to reopen.

@IlmariKaronen, I would say that "Generating PBM bitmap files" is so similar that this counts as a dupe.

source: Stack Exchange

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

sort: votes


text:
Set Theory Operations Union Only
My obsession with set theory continues. I believe that most programming languages have neither sets as possible structures nor set theory operations such as Union and Intersection. If I am wrong then this question becomes trivial and I learn something new.
It would be fun to ask for the code golf construction of a full set structure where a set could contain any possible structures within the language and operators such as is a member of, is a subset of, union and intersection etc. However that is much too broad. So I will simplify the puzzle.
Terminology
An Alphaset has only lower case letters as elements.
The structure for an Alphaset can be defined as you wish and the method used should be explained. It could be just a list of letters read from a file.
As an example I will use an array as a structure for an Alphaset.
An Alphaset can contain a letter once only and order does not matter.
['a','b','c'], ['b','c','a'] and ['c','a','b'] are equivalent Alphasets.
The operation Union forms an Alphaset from two Alphasets.
['a','b','c'] Union ['d','a', 'g', 'b'] is ['a', 'b', 'c', 'd', 'g'] or an equivalent.
A Big Alphaset has the same structure as an Alphaset but can contain repeated letters, eg ['a', 'b', 'a', 'c', 'b'] is a Big Alphaset.
If A and B are any combination of Alphasets and Big Alphasets then A Union B must return an Alphaset.
This gives a way of producing an Alphaset from a Big Alphaset should it ever be necessary for when A is a Big Alphaset the A Union A will be an Alphaset.
Puzzle
Input
A an Alphaset or Big Alphaset
B an Alphaset or Big Alphaset
Ouput
An Alphaset that is the Union of A and B.
Test Data
Testing should demonstrate that order of elements within the Alphaset does not matter.
ie the following should all produce equivalent results.
['a','b','c'] Union ['a', 'c', 'd']
['b','c','a'] Union ['c', 'd', 'a']
['c','b','a'] Union ['d', 'a', 'c']
Shortest code wins

This is actually the built-in Ruby behavior for the | operator on arrays.

.NET also has sets built-in. (HashSet<T>)

This question appears to be off-topic because it is extremely trivial.

Python2 - 21 (or 15) (or 1)
Sets should be in the format set([element1, element2, element3...])
print input()|input()

If running from the interactive prompt is allowed, remove the print.
Note: If the Mathematica answer qualifies as being 1 character, then in the Python interactive prompt this should also qualify as 1 character:
set(['a','b','d','z'])|set(['c','z','d','a','k','a'])

Sample input:
set(['a','b','d','z'])
set(['c','z','d','a','k','a'])

Sample output:
set(['a', 'c', 'b', 'd', 'k', 'z'])

In Python 3, that would be print(eval(input()+"|"+input())).

@golfer9338 You're right, I should probably specify Python2.

Mathematica, 1 Chars
It's a built-in feature:

APL - 1 char
∪ is the union operator, so 1 2 3∪3 4 5 returns 1 2 3 4 5. In APL, there are no brackets around lists.
Other diadic (two-argument) set operators in APL are ∩ (intersection) and ~ (Without):
1 2 3∩3 4 5 = 3, 1 2 3 4 5~1 3 = 2 4 5
Many languages have libraries built especially to deal with sets:

Haskell - Data.Set
Java - java.util.Set (an interface implemented by 8+ builtin classes)
c++ - std::set
Ecmascript 6 will have a Set object

Almost every language has some sort of way to handle sets. Usually googling "somelanguage set" will point you towards the documentation for that language's set

Bash + coreutils, 30
Not sure how strictly the input and output formats need to be followed, but this does a union correctly:
echo `tr \  "
"<<<$@|sort -u`

In action:

$ ./union.sh "a b c" "a c d"
a b c d
$ ./union.sh "b c a" "c d a"
a b c d
$ ./union.sh "c b a" "d a c"
a b c d
$

Golfscript, 3 bytes
~|p

Example
$ echo '["a" "c" "d" "b" "c"] ["f" "b" "e"]'| golfscript alpha.gs
["a" "c" "d" "b" "f" "e"]

How it works
~ # Interpret the input string.
| # Setwise OR (union)
p # print


text:
Generate the python dictionary of phone keypresses for any letter
In the fewest bytes, generate the dictionary of keypresses for any letter (as described in https://code.google.com/codejam/contest/351101/dashboard#s=p2)
In Python, the dictionary literal itself:
{'a':2,'c':222,'b':22,'e':33,'d':3,'g':4,'f':333,'i':444,'h':44,'k':55,'j':5,'m':6,'l':555,'o':666,'n':66,'q':77,'p':7,'s':7777,'r':777,'u':88,'t':8,'w':9,'v':888,'y':999,'x':99,'z':9999}

is 187 bytes so it needs to be less than that.  (The values can be strings or ints, ie you can have 'a':'2' or 'a':2 it's up to you)
NOTE: This is not asking you to solve the referenced GCJ problem, it's just asking you to generate a particular dictionary which is related to that problem.
EDIT: You may solve this in any language which has a dictionary-like type (ie hashmap, associative array etc.)

Do we have to solve this in Python, or can we use any language to generate and output the dictionary literal?

I guess any language.  Let me fix that

Also, looks like the GCJ problem itself has been asked here before.

Huh, I should have checked that first.  I posted this because we were talking about how to generate this dictionary (in Python) on #gcj on Freenode

Order doesn't matter?

You should be using an unordered data-type.  This problem isn't to "output" the result, it's to "generate" it

Do all values have to be the same type? ex:{a:2,b:"22"...} and do the dictionary keys have to be lowercase letters?

Is the idea to store it in a variable or to print a correctly-formatted dict literal? The latter seems more interesting

perl, 49 48 bytes
Using a different algorithm than my previous answer, we can lose another 12 bytes. The basic idea is that you usually just add the digit from the last letter's solution over again. We handle the other cases (detected by a short regex) by starting with a single instance of the last digit + 1.
{map{$d++,$t=""if/[dgjmptw]/;$_,$t.=$d||=2}a..z}

With output:
ski@anito:~/src$ perl -MData::Dumper  -e '$Data::Dumper::Sortkeys=1; $d=2;print Dumper {map{$d++,$t=""if/[dgjmptw]/;$_,$t.=$d}a..z}'
$VAR1 = {
      'a' => '2',
      'b' => '22',
      'c' => '222',
      'd' => '3',
      'e' => '33',
      'f' => '333',
      'g' => '4',
      'h' => '44',
      'i' => '444',
      'j' => '5',
      'k' => '55',
      'l' => '555',
      'm' => '6',
      'n' => '66',
      'o' => '666',
      'p' => '7',
      'q' => '77',
      'r' => '777',
      's' => '7777',
      't' => '8',
      'u' => '88',
      'v' => '888',
      'w' => '9',
      'x' => '99',
      'y' => '999',
      'z' => '9999'
};

Woo! Suck it J and Golfscript. Perl 4 eva! ;-)

Python (83)(87)
c,d=97,{}
for i in range(2,10):
 for j in range(1,4+(i>6)*i%2):d[chr(c)],c=j*str(i),c+1

The dictionary is stored in d. The condition check (i>6)*i%2 saves two chars from (i in[7,9]).
Edit:
c=97;d={}
for i in range(8):
 for j in range(1,4+(i|2>6)):d[chr(c)]=j*str(i+2);c+=1

Shaved 4 characters. With i shifted down by 2, we recognize the special cases of 7 and 9 by checking if i is 5 or 7 using i|2>6.

(6<i<10) saves another character.

@isaacg but it includes 8...

Golfscript, 68 characters
"{'"26,{.[.",'"''if\97+"':"]''+\..11-
7/.0>*-.3/2[+]\3%)@18=+*}/"9}"

What's this, you say? It outputs the correct Python dict literal:
{'a':2,'b':22,'c':222,'d':3,'e':33,'f':333,'g':4,'h':44,'i':444,'j':5,'k':55,'l':555,'m':6,'n':66,'o':666,'p':7,'q':77,'r':777,'s':7777,'t':8,'u':88,'v':888,'w':9,'x':99,'y':999,'z':9999}

That is,
$ echo print `ruby golfscript.rb phonetyp.gs` | python
{'a': 2, 'c': 222, 'b': 22, 'e': 33, 'd': 3, 'g': 4, 'f': 333, 'i': 444, 'h': 44, 'k': 55, 'j': 5, 'm': 6, 'l': 555, 'o': 666, 'n': 66, 'q': 77, 'p': 7, 's': 7777, 'r': 777, 'u': 88, 't': 8, 'w': 9, 'v': 888, 'y': 999, 'x': 99, 'z': 9999}

Python, 86 characters
Alternate Python solution:
d={}
for a in range(26):n=a-max(0,(a-11)/7);d[chr(a+97)]=`n/3+2`*(n%3+1+(a in(18,25)))

For this range max(0,(a-11)/7) = max(0,a-11)/7 = a/18-a/25. You can squeeze 2 or even 6 more bytes ;)

JavaScript (ES5) 88 86 85 bytes
for(o={},a=c=2,b=96;a-10;a=a<(c%9%7?b:1e3)?a+[c]:++c)o[String.fromCharCode(++b)]=+a;o

Result:
{"a":2,"b":22,"c":222,"d":3,"e":33,"f":333,"g":4,"h":44,"i":444,"j":5,"k":55,"l":555,"m":6,"n":66,"o":666,"p":7,"q":77,"r":777,"s":7777,"t":8,"u":88,"v":888,"w":9,"x":99,"y":999,"z":9999}

If mixed types are allowed, it can be reduced by 1 byte.
86 84 bytes:
for(o={},a=c=2,b=96;a-10;a=a<(c%9%7?b:1e3)?a+[c]:++c)o[String.fromCharCode(++b)]=a;o

Result:
{"a":2,"b":"22","c":"222","d":3,"e":"33","f":"333","g":4,"h":"44","i":"444","j":5,"k":"55","l":"555","m":6,"n":"66","o":"666","p":7,"q":"77","r":"777","s":"7777","t":8,"u":"88","v":"888","w":9,"x":"99","y":"999","z":"9999"}

perl, 61 bytes
Examine the mod3 and div3 of a counter $t to determine the base digit and number of repetitions. Handle the special cases of s and z separately.
$t=5;{map{$b=++$t%3+1;$b=4,--$t if/s|z/;$_,int($t/3)x$b}a..z}

With string output:
perl -MData::Dumper -e '$Data::Dumper::Sortkeys=1; $t=5;print Dumper {map{$b=++$t%3+1;$b=4,--$t if/s|z/;$_,int($t/3)x$b}a..z}'
$VAR1 = {
      'a' => '2',
      'b' => '22',
      'c' => '222',
      'd' => '3',
      'e' => '33',
      'f' => '333',
      'g' => '4',
      'h' => '44',
      'i' => '444',
      'j' => '5',
      'k' => '55',
      'l' => '555',
      'm' => '6',
      'n' => '66',
      'o' => '666',
      'p' => '7',
      'q' => '77',
      'r' => '777',
      's' => '7777',
      't' => '8',
      'u' => '88',
      'v' => '888',
      'w' => '9',
      'x' => '99',
      'y' => '999',
      'z' => '9999'
    };

And here's a more readable version of the code:
{
  map {
    my $reps = (++$pos % 3) + 1;
    if($_ =~ /s|z/) {
      --$pos;
      $reps=4;
    }
    my $digit = int( $pos/3 );
    $_ => $digit x $reps
  } ('a'..'z')
}

We start with $pos = 5 so that int(++$pos/3) starts off at 2.
We handle the case of s and z separately since they are the only exceptions to the modulo 3 rule.

J - 57 char
The closest analogue to the dictionary datatype in J is a table of boxes: each row is an entry, containing the key on the left and the data on the right. It's not really unordered, but whenever you need a dictionary type of record, you would use something like this.
_2]\;n(;&.><\)/@|:/.n,.~u:97+i.#n=.,":"0(#~3+e.&7 9)2+i.8

n is the string '22233344455566677778889999', which we create by taking the list 2 3 4 5 6 7 8 9 and taking three of 4 of each element, depending on whether the element is 7 or 9. Then we just convert each item to a string and run them together into a single string.
Then we make the alphabet, attach the digits to the alphabet with ,.~, and then group them by the digits (this is /. at work). Within each group, we pair off the letter with the corresponding prefix of the string of same digits.
Finally, we run things together: ; to take off the effects of the earlier grouping and _2]\ to put it into the proper table shape.
   _2]\;n(;&.><\)/@|:/.n,.~u:97+i.#n=.,":"0(#~3+e.&7 9)2+i.8
+-+----+
|a|2   |
+-+----+
|b|22  |
+-+----+
|c|222 |
+-+----+
|d|3   |
+-+----+
|e|33  |
+-+----+
|f|333 |
+-+----+
|g|4   |
+-+----+
|h|44  |
+-+----+
|i|444 |
+-+----+
|j|5   |
+-+----+
|k|55  |
+-+----+
|l|555 |
+-+----+
|m|6   |
+-+----+
|n|66  |
+-+----+
|o|666 |
+-+----+
|p|7   |
+-+----+
|q|77  |
+-+----+
|r|777 |
+-+----+
|s|7777|
+-+----+
|t|8   |
+-+----+
|u|88  |
+-+----+
|v|888 |
+-+----+
|w|9   |
+-+----+
|x|99  |
+-+----+
|y|999 |
+-+----+
|z|9999|
+-+----+

Mathematica, 168
This is the longest answer here... I'm sure there's a better way to do this.
(k=#2[[1]]+1;Append[{},{#->StringJoin@ConstantArray[ToString@k,#2]}]&~MapIndexed~#)&~MapIndexed~Characters@{"abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"}~Flatten~3

Output:
{"a" -> "2", "b" -> "22", "c" -> "222", "d" -> "3", "e" -> "33",
"f" -> "333", "g" -> "4", "h" -> "44", "i" -> "444", "j" -> "5",
"k" -> "55", "l" -> "555", "m" -> "6", "n" -> "66", "o" -> "666",
"p" -> "7", "q" -> "77", "r" -> "777", "s" -> "7777", "t" -> "8",
"u" -> "88", "v" -> "888", "w" -> "9", "x" -> "99", "y" -> "999",
"z" -> "9999"}

Bash + coreutils, 91 bytes
p="printf %s\n"
paste <($p {a..z}) <($p {2..9} {22..99..11} {222..999..111} 7777 9999|sort)

Generates a tab-delimited table, which is a natural structure for a shell script - not sure if that meets the specs or not:

a   2
b   22
c   222
d   3
...
r   777
s   7777
t   8
u   88
v   888
w   9
x   99
y   999
z   9999

Pure Bash, 137 bytes
Not very good.
declare -A a
b=({X..z})
for n in {9..33};do
c=${b[n]}
((n>26?n--:n))
printf -vk %$[n%3+1]s
a[$c]=${k// /$[n/3-1]}
done
a[s]+=7
a[z]=9999

This populates a bash associative array.
Crudely display it as follows:

$ for c in ${!a[@]}; do echo -n $c:${a[$c]},;done; echo
a:2,b:22,c:222,d:3,e:33,f:333,g:4,h:44,i:444,j:5,k:55,l:555,m:6,n:66,o:666,p:7,q:77,r:777,s:7777,t:8,u:88,v:888,w:9,x:99,y:999,z:9999,
$

Python 2 (97)
I used a single dictionary comprehension:
{zip(*[(chr(i)for i in range(65,91))]*3)[i][k]:str(i+2)*(k+1)for k in range(3)for i in range(8)}

Unfortunately it's missing the z because on number 9 there are 4 letters.

You could manually add the z for a few more characters. Also remove the space between the many ...) for... to ...)for...

Y is also missing

Clojure, 91 bytes
(zipmap(map char(range 97 123))(for[i(range 2 10)r(range 1(get{7 5 9 5}i 4))](repeat r i)))

for is ideal for generating these kinds of sequences. Output looks like this:
{\a (2), \b (2 2), \c (2 2 2), \d (3), ...