text:
Email validation
Write a function or program to validate an e-mail address against RFC 5321 (some grammar rules found in 5322) with the relaxation that you can ignore comments and folding whitespace (CFWS) and generalised address literals. This gives the grammar
Mailbox              = Local-part "@" ( Domain / address-literal )

Local-part           = Dot-string / Quoted-string
Dot-string           = Atom *("."  Atom)
Atom                 = 1*atext
atext                = ALPHA / DIGIT /    ; Printable US-ASCII
                       "!" / "#" /        ;  characters not including
                       "$" / "%" /        ;  specials.  Used for atoms.
                       "&" / "'" /
                       "*" / "+" /
                       "-" / "/" /
                       "=" / "?" /
                       "^" / "_" /
                       "`" / "{" /
                       "|" / "}" /
                       "~"
Quoted-string        = DQUOTE *QcontentSMTP DQUOTE
QcontentSMTP         = qtextSMTP / quoted-pairSMTP
qtextSMTP            = %d32-33 / %d35-91 / %d93-126
quoted-pairSMTP      = %d92 %d32-126

Domain               = sub-domain *("." sub-domain)
sub-domain           = Let-dig [Ldh-str]
Let-dig              = ALPHA / DIGIT
Ldh-str              = *( ALPHA / DIGIT / "-" ) Let-dig

address-literal      = "[" ( IPv4-address-literal / IPv6-address-literal ) "]"
IPv4-address-literal = Snum 3("."  Snum)
IPv6-address-literal = "IPv6:" IPv6-addr
Snum                 = 1*3DIGIT
                       ; representing a decimal integer value in the range 0 through 255

Note: I've skipped the definition of IPv6-addr because this particular RFC gets it wrong and disallows e.g. ::1. The correct spec is in RFC 2373.
Restrictions
You may not use any existing e-mail validation library calls. However, you may use existing network libraries to check IP addresses.
If you write a function/method/operator/equivalent it should take a string and return a boolean or truthy/falsy value, as appropriate for your language. If you write a program it should take a single line from stdin and indicate valid or invalid via the exit code.
Test cases
The following test cases are listed in blocks for compactness. The first block are cases which should pass:
email@domain.com
e@domain.com
firstname.lastname@domain.com
email@subdomain.domain.com
firstname+lastname@domain.com
email@123.123.123.123
email@[123.123.123.123]
"email"@domain.com
1234567890@domain.com
email@domain-one.com
_______@domain.com
email@domain.name
email@domain.co.jp
firstname-lastname@domain.com
""@domain.com
"e"@domain.com
"\@"@domain.com
email@domain
"Abc\@def"@example.com
"Fred Bloggs"@example.com
"Joe\\Blow"@example.com
"Abc@def"@example.com
customer/department=shipping@example.com
$A12345@example.com
!def!xyz%abc@example.com
_somename@example.com
_somename@[IPv6:::1]
fred+bloggs@abc.museum
email@d.com
?????@domain.com

The following test cases should not pass:
plainaddress
#@%^%#$@#$@#.com
@domain.com
Joe Smith <email@domain.com>
email.domain.com
email@domain@domain.com
.email@domain.com
email.@domain.com
email.email.@domain.com
email..email@domain.com
email@domain.com (Joe Smith)
email@-domain.com
email@domain..com
email@[IPv6:127.0.0.1]
email@[127.0.0]
email@[.127.0.0.1]
email@[127.0.0.1.]
email@IPv6:::1]
_somename@domain.com]
email@[256.123.123.123]

since IPv6-addr has been left undefined, and there are test cases that have ipv6 addresses, is there a correct way to validate them?

Why should email@d.com and ?????@domain.com fail?

@ardnew, I've added a link to the relevant RFC. I don't want to inline it because the question is already quite long.

@grc, good question. I've checked them, because no-one raised this during the several months that the question was in the sandbox, but I can't see why they should fail so I've moved them to the "Pass" side.

Are length limits required as well? 254 for entire email address/64 for local-part/63 for each domain label?

Python 3.3, 261
import re,ipaddress
try:v,p=re.match(r'^(?!\.)(((^|\.)[\w!#-\'*+\-/=?^-~]+)+|"([ !#-[\]-~]|\\[ -~])*")@(((?!-)[a-zA-Z\d-]+(?<!-)($|\.))+|\[(IPv6:)?(.*)\])(?<!\.)$',input()).groups()[7:];exec("if p:ipaddress.IPv%dAddress(p)"%(v and 6or 4))
except:v=5
print(v!=5)

Python 3.3 is needed for the ipaddress module, which is used to validate IPv4 and IPv6 addresses.
Less golfed version:
import re, ipaddress

dot_string = r'(?!\.)((^|\.)[\w!#-\'*+\-/=?^-~]+)+'
    # negative lookahead to check that string doesn't start with .
    # each atom must start with a . or the beginning of the string

quoted_string = r'"([ !#-[\]-~]|\\[ -~])*"'
    # - is used for character ranges (also in dot_string)

domain = r'((?!-)[a-zA-Z\d-]+(?<!-)($|\.))+(?<!\.)'
    # negative lookahead/lookbehind to check each subdomain doesn't start/end with -
    # each domain must end with a . or the end of the string
    # negative lookbehind to check that string doesn't end with .

address_literal = r'\[(IPv6:)?(.*)\]'
    # captures the is_IPv6 and ip_address groups

final_regex = r'^(%s|%s)@(%s|%s)$' % (dot_string, quoted_string, domain, address_literal)

try:
    is_IPv6, ip_address = re.match(final_regex, input(), re.VERBOSE).groups()[7:]
        # if input doesn't match, calling .groups() will throw an exception

    if ip_address:
        exec("ipaddress.IPv%dAddress(ip_address)" % (6 if is_IPv6 else 4))
            # IPv4Address or IPv6Address will throw an exception if ip_address isn't valid
except:
    is_IPv6 = 5

print(is_IPv6 != 5)
    # is_IPv6 is used as a flag to tell whether an exception was thrown

very nice. i can't immediately find any duplicate patterns (to replace with a shorter variable identifier). but it looks like ALPHA in augmented BNF and the char literals constructing a Quoted-string are all case-insensitive. can you shave a few chars by specifying case-insensitivity and ditching one of those char class ranges? btw, if you're feeling frisky, can you give a short description of how you developed this?

@ardnew: Thanks. I've added a less golfed version with a few comments trying to explain some of the trickier parts. I developed the regex in four individual pieces (dot-string, quoted-string, domain and address-literal), then merged them together and added the ip validation. Needless to say, golfing it got really messy.

No length limits?

PHP 5.4.9, 495
function _($e){return preg_match('/^(?!(?>"?(?>\\\[ -~]|[^"])"?){255,})(?!"?(?>\\\[ -~]|[^"]){65,}"?@)(?>([!#-\'*+\/-9=?^-~-]+)(?>\.(?1))*|"(?>[ !#-\[\]-~]|\\\[ -~])*")@(?!.*[^.]{64,})(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)(?>\.(?2)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?3)){7}|(?!(?:.*[a-f0-9][:\]]){8,})((?3)(?>:(?3)){0,6})?::(?4)?))|(?>(?>IPv6:(?>(?3)(?>:(?3)){5}:|(?!(?:.*[a-f0-9]:){6,})(?5)?::(?>((?3)(?>:(?3)){0,4}):)?))?(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)(?>\.(?6)){3}))\])$/iD', $e);}

And just for further interest, here's one for RFC 5322 grammar which allows for nested CFWS and obsolete local-parts:
(764)
function _($e){return preg_match('/^(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){65,}@)((?>(?>(?>((?>(?>(?>\x0D\x0A)?[\t ])+|(?>[\t ]*\x0D\x0A)?[\t ]+)?)(\((?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?!(?1)[a-z\d-]{64,})(?1)(?>([a-z\d](?>[a-z\d-]*[a-z\d])?)(?>(?1)\.(?!(?1)[a-z\d-]{64,})(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f\d]{1,4})(?>:(?6)){7}|(?!(?:.*[a-f\d][:\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:|(?!(?:.*[a-f\d]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)(?>\.(?9)){3}))\])(?1)$/isD', $e);}

And if length-limits are not a requirement:
RFC 5321 (414)
function _($e){return preg_match('/^(?>([!#-\'*+\/-9=?^-~-]+)(?>\.(?1))*|"(?>[ !#-\[\]-~]|\\\[ -~])*")@(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)(?>\.(?2)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?3)){7}|(?!(?:.*[a-f0-9][:\]]){8,})((?3)(?>:(?3)){0,6})?::(?4)?))|(?>(?>IPv6:(?>(?3)(?>:(?3)){5}:|(?!(?:.*[a-f0-9]:){6,})(?5)?::(?>((?3)(?>:(?3)){0,4}):)?))?(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)(?>\.(?6)){3}))\])$/iD', $e);}

RFC 5322 (636)
function _($e){return preg_match('/^((?>(?>(?>((?>(?>(?>\x0D\x0A)?[\t ])+|(?>[\t ]*\x0D\x0A)?[\t ]+)?)(\((?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?1)(?>([a-z\d](?>[a-z\d-]*[a-z\d])?)(?>(?1)\.(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f\d]{1,4})(?>:(?6)){7}|(?!(?:.*[a-f\d][:\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:|(?!(?:.*[a-f\d]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)(?>\.(?9)){3}))\])(?1)$/isD', $e);}


text:
Type "Hello, World!"
Write a program which generates keyboard events which type Hello, World!.
It doesn't have to be platform-independent.
It can't leave any keys pressed.  For example, in Java, Robot.KeyPress('H'); will leave H pressed, so you must release it with Robot.KeyRelease('H');
You may assume that the caps lock is off when your program is run.  Capital letters can be typed either by holding shift and pressing the letter, or by toggling caps lock.  For the !, you'll probably have to use the shift method.
Shortest code wins.

C (Linux), 186 bytes
#include<sys/ioctl.h>
#include<fcntl.h>
#include<stdio.h>
main(){char*s="Hello, World!",d[99],*c;fscanf(popen("tty","r"),"%s",d);int D=open(d,O_RDWR);for(c=s;*c;c++)ioctl(D,TIOCSTI,c);}

After applying ugoren's suggestions:
111 bytes
main(D){char*c,d[99];fscanf(popen("tty","r"),"%s",d);D=open(d,2);for(c="Hello, World!";*c;)ioctl(D,21522,c++);}

You can shorten some. Remove s (just initialize for(c="H..), increment c in the ioctl, main(D) to save int. Maybe also remove some includes (even hard-code O_RDWR and TIOCSTI).

@ugoren Thanks, I'll try them :)

This one is not the shortest. Why is this the accepted answer? (I think it is a nice answer, but I just want to learn how the site works.)

@11684 The author of the shortest answer asked me not to count it, so I accepted the shortest non-trivial answer instead.

No need to call tty it only works if stdin is a tty, in which case, 0 is already an open terminal fd.

AppleScript, 50 bytes
tell app"System Events"to keystroke"Hello, World!"

Thanks to marinus for the suggestion.

Huh.  Looks like you chose the right language for the right job.

You can shorten it to tell app"System Events"to keystroke"Hello, World!".

Damnit, I thought of this independently... +1!

Autohotkey, 20 bytes
send Hello, World{!}

Please don't count this one. I don't want to cheat out people who have actually done this with a language not meant for sending keystrokes. This answer is just for completion :P

C in Windows 7, 201 bytes
#include<windows.h>
#include<winable.h>
#define S SendInput(1,&k,28);
int k[7]={1};main(i){char*s="^HELLO, ^WORLD^1";for(i=0;i<16;i++){k[2]=0;if(s[i]>90){k[1]=16;S i++;}k[1]=s[i];S k[2]=2;S k[1]=16;S}}

Program result:
C:\My\Directory>type.exe

C:\My\Directory>Hello, World!

Emacs Lisp, 34 bytes
(execute-kbd-macro"Hello, World!")

Ducky Script for USB Rubber Ducky, 22 bytes
String "Hello, World!"

Tcl, 46 bytes
package r Expect;spawn bash;send Hello,\ World

Expect, 29 bytes
spawn bash;send Hello,\ World

Tried to do the Tk version, but failed: file with some stuff https://pastebin.ca/3897417

AutoIt3, 21 bytes
Send("Hello, World!")

missing comma! It's actually 21 chars

Where is a comma supposed to be? Edit, never mind, lol.

VBScript, 54 bytes
createobject("wscript.shell").sendkeys "Hello, World!"

InstantEXE 3.0, 20 bytes
Keys "Hello, World!"

PowerShell, 55 bytes
(New-Object -c wscript.shell).sendkeys('Hello, World!')

Python 3,67 bytes
from pynput.keyboard import*
s=Controller()
s.type("Hello, World!")

No module named pynput on tio

Controller().type("Hello, World!") ?

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:
Shortest conditional to run a specific statement: C code golf
Currently I have the code (expanded for your benefit):
<number> != <number> ? printf("|\\"); : <number>;

The idea here, is to do this condition in the least number of characters. This is currently, roughly the same number of characters it would take to be doing the exact same thing using an if statement, due to the fact, that I am fulfilling the second argument of the ternary operator which does not need to be filled, it is simply filled, as otherwise the statement does not run. (the final number is really a variable).
Is there any possible way to do the same conditional but shorter? (in C)

if(x!=y)printf("foo\n");
x!=y?printf("foo\n"):0;
x==y||printf("foo\n");

Yes, you can save some characters with the ternary operator or with the shortcutting logic operators (&& and ||).  All three of the above do the same thing.  Which you can use depends on things like the return type of printf and whether you need the return value.
Does that answer your question?

Very good, excellent answer.

A year late but one whole character shorter.
x-y&&printf("foo\n");

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


text:
Build a 12-hour digital clock
In my essay "Use the 24-hour clock", I claim that trying to represent the 12-hour clock directly in data is a terrible exercise in patchy, inelegant programming:

"No problem, we'll just use computers to do these calculations for us." Yes, but computers need to be programmed. And trying to account for AM and PM directly in a computer program, especially the extremely tricky way we've encoded it, with 12 representing 0, is prone to bugs and programming mistakes, which can cost millions at the airport in scheduling mishaps. As it is, it's much easier for computers to work in 24-hour time in internal calculations, and then convert the times to 12-hour time for easy human reading, instead of having to deal with dozens of notational issues as would be the case when using 12-hour time directly. In which case, why not just get rid of the whole 12-hour conversion and work with 24-hour time in the first place?

Here's your chance to prove me wrong. Your task is to build a Clock class that supports the following functions:

addHours(x), that advances the clock by x hours (or moves back |x| hours if x is negative)
addMinutes(x), that advances the clock by x minutes.
diffMinutes(c1, c2) that gives the time difference from clock c1 to clock c2 in minutes (which always assumes that c1 and c2 are representing times in the same day). If c2 is earlier than c1, the time should be negative.

and has the following publicly accessible variables:

hours, which represents the hour digit of the clock, from 1 to 12.
minutes, which represents the minute digit of the clock, from 0 to 59.
ampm, which is true if the clock is AM and false if the clock is PM.

as well as a setter and getter method (e.g. setHours(hours) and getHours()) for each. (You may assume that the setters and getters will always be passed valid values.) The reason the variables must be publicly accessible is to ensure that the internal data representation of the clock is also in a 12-hour format, to fit the data representation of the clock described in the essay.
Your code must pass all the unit tests contained in this file (translated to the programming language of your choice) except for test 0.2, which should be removed for this problem. (If the descriptions of the corner cases and their resultant times start to make your head spin, that's good. It means that my point about the strangeness of the notation is verified. It certainly made my head spin trying to make sure I had all the corner cases covered.)
Your score is calculated based on the number of operators and function calls in your class code, rather than the number of characters (so don't golf your code, make it readable but still short). Lowest score wins, of course.
Note: This problem has a part 2, namely, to create a 12-hour clock that uses 24-hour time in its internal representation. If my hypothesis is true, the winner of that problem will have a much lower score than the winner of this problem.

file= dead link!

does it really need to be a class? What if the language I use is not "classy" by nature?

Voting to close as an [tag:atomic-code-golf] must specify exactly what counts as, e.g., an operator. Additionally, the requirement to use a 12-hour format internally is mostly unobservable, without relying on more language-specific features.

Python (38)
Full code with tests here. A ton of the tests were wrong, so I modified them. Most of the changes are marked with the string "patch" in a comment, but I'm sure I forgot to mark some.
It was completely unclear if diffMinutes(a, b) was abs(a-b), a-b or b-a, so I went with b-a because I had to change less tests that way.
Also, ampm is a terrible variable name. isAM would be a far more readable name, and isPM would be preferable, as true and false are often associated with 1 and 0, and PM is a higher/later value.
The interesting part (getters and setters in the link above):
def getMinutesFromMidnight(clock):
    return clock.hours * 60 % 720 + 720 * (not clock.ampm) + clock.minutes

def diffMinutes(a,b):
    return getMinutesFromMidnight(b) - getMinutesFromMidnight(a)

class Clock(object):
    def __init__(self):
        self.hours = 12
        self.minutes = 0
        self.ampm = True

    def addHours(self, hours):
        self.addMinutes(hours * 60)

    def addMinutes(self, minutes):
        minutes = getMinutesFromMidnight(self) + minutes
        self.hours = minutes / 60 % 12 or 12
        self.minutes = minutes % 60
        self.ampm = minutes % 1440 < 720

Yeah, ampm is a pretty bad variable name. It's a carry-over from ampm being "am" and "pm" text variables instead, but I just didn't change it when I decided to use a boolean variable instead.

I've repatched the unit tests according to your patches. Could you verify that they're correct?

I've counted the number of operators and function calls and your score turns out to be 38. I counted the "." for accessing a class name (except when it involved a "self" variable) as an operator.

Sounds good, thanks for scoring it.  Remaining problems in the tests: s/setampm/setAMPM/g, s/diffHours/diffMinutes/g, in 2.5.2 s/-1/1/, in 3.2.4 s/true/false, in 3.2.7 s/719/-719/


text:
Build an analog clock
Write a program which displays the current system time as an analog clock, using ASCII graphics. The clock must show at least the hour and minute pointers, and must have enough resolution of at least 5 minutes.
The display can be as small and as ugly as you wish, but the shown time should be easily recognizable.
The program has to run continuously and update its status. If your system can clear the screen, use it, otherwise it's enough to repaint the clock when its state changes.
You get a -20% bonus on the character count if the clock has at least a 1 minute resolution.

When you say analog clock do you mean the usual one or any form of analog rappresentation of time?

Extra bonus for 1 second resolution?

Is that "get a -20% bonus" for real? Shouldn't it be... positive?

@Timtech : if you really want it, I could add 20% to your character count...

@vsz What do you mean ;?

@vsz WOW! Failed to understand you... until now ;)

Mathematica 207 - 42 = 165
The ticks and hour labels are placed on the unit circle.
H and M revolve around the clock center showing the whole number of completed hours and minutes, respectively.
S updates its position several times each second.
Two versions are shown: a version that plots text in the Cartesian plane, and another that displays text characters in a grid.
This version plots the characters into the Cartesian plane.
d = Dynamic; t = Table; x = Text;i_~u~k_ := {Sin[2 \[Pi] i/k], Cos[2 \[Pi] i/k]};
d[{f = Date[], Clock[{1, 1}, 1]}]
Graphics[d@{t[x[".", u[i, 60]], {i, 60}],t[x[i, u[i, 12]], {i, 12}],
x["H", .7 u[f〚4〛, 12]],x["M", .8 u[f〚5〛, 60]],x["S", .9 u[f〚6〛, 60]]}]

The clock below shows the time 3:08:17.

Terminal or Grid Version: 430 316 chars (253 with bonus discount)
This version works much the same, but places the characters in a 61 x 61 cell grid rather than in the Cartesian plane.
It could still be golfed a bit, but I merely wanted to show a (sloppier) terminal-like output  in Mathematica.
d = Dynamic; i_~u~k_ := Round /@ (10 {Sin[2 \[Pi] (i + 3 k/4)/k],
Cos[2 \[Pi] (i + 3 k/4)/k]}); d[{f = Date[], Clock[]}]
z = Round /@ (# u[f[[#2]], #3] + 11) -> #4 &;
t = Table[( u[i, 12] + 11) -> i, {i, 12}];
d@Grid[ReplacePart[ConstantArray["", {21, 21}],
Join[z @@@ {{.9, 5, 60, "M"}, {.8, 4, 12, "H"}},
DeleteCases[Table[( u[i, 60] + 11) -> "*", {i, 60}], x_ /; MemberQ[t[[All, 1]], x[[1]]]], t]]]

The clock below displays 11:06.

Just for fun:
Here's a non-Ascii version of the analog clock.  (60 chars) No external libraries were used.
Dynamic@Refresh[ClockGauge@AbsoluteTime[], UpdateInterval -> 1]

Doesn't look like ASCII art to me.

I followed the definition given in Wikipedia: "ASCII art is a graphic design technique that uses computers for presentation and consists of pictures pieced together from the 95 printable (from a total of 128) characters defined by the ASCII Standard from 1963 and ASCII compliant character sets with proprietary extended characters (beyond the 128 characters of standard 7-bit ASCII). The term is also loosely used to refer to text based visual art in general."

Hmm. I suppose that works. I expect that vsz was expecting terminal art, though. Perhaps he can clarify.

Javascript 370 - 74 = 296
http://jsfiddle.net/wBKQ6/7/
(This only works in Chrome because I'm abusing the fact that element IDs are added to the global scope).
(function loop(){
    M=Math;p=M.PI/2;z=M.pow;q=M.sqrt;d=new Date();h=(d.getHours()%12/3*p+p)%(p*4);m=(d.getMinutes()/15*p+p)%(p*4);s=(d.getSeconds()/15*p+p)%(p*4);e=49;o='';

    for(r=0;r<99;r++){
        for(c=0;c<99;c++){
            d=q(z(r-e,2)+z(c-e,2));
            a=(M.atan2(e-r,e-c)+p*4)%(p*4);
            E=(d<e*.8&&M.abs(m-a)*d<.5) || (d<e*.5&&M.abs(h-a)*d<.5) || (d<e*1&&M.abs(s-a)*d<.5);
            o+=d-e>0||d<1||E||(e-d<5&&a%p==0)?'●':'○';
            //■□●○
        }
        o+='\n';
    }
    O.innerText=o
    setTimeout(loop,1000);
})()

Golfed (370):
!function L(){p=M.PI/2;q=p*4;P=M.pow;d=new Date();s=(d.getSeconds(S=d.getMinutes(e=40))/15*p+p)%q;m=(S/15*p+p)%q;h=(d.getHours(A=M.abs)%12/3*p+S/180*p+p)%q;for(r=o='';r<81;r++,o+='\n')for(c=0;c<81;){d=M.sqrt(P(r-e,2)+P(c-e,2));a=(M.atan2(e-r,e-c++)+q)%q;o+='○●'[d-e>0|d<e*.8&A(m-a)*d<1|d<e/2&A(h-a)*d<1|d<e&A(s-a)*d<1|e-d<5&a%p==0]}O.innerText=o;setTimeout(L,9)}(M=Math)

Sample Output (much more condensed in demo):
●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
●●●●●●●●●●●●●●○○○○○○●○○○○○○●●●●●●●●●●●●●●
●●●●●●●●●●●●○○○○○○○○●○○○○○○○○●●●●●●●●●●●●
●●●●●●●●●●○○○○○○○○○○●○○○○○○○○○○●●●●●●●●●●
●●●●●●●●○○○○○○○○○○○○●○○○○○○○○○○○○●●●●●●●●
●●●●●●●○○○○○○○○○○○○○○○○○○○○○○○○○○○●●●●●●●
●●●●●●○○○○○○○○○○○○○○○○○○○○○○○○○○○○○●●●●●●
●●●●●○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○●●●●●
●●●●○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○●●●●
●●●●○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○●●●●
●●●○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○●●●
●●●○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○●●●
●●○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○●●
●●○○○○○○○○○○○○○○○○○○○○○○○○○●○○○○○○○○○○○●●
●○○○○○○○○○○○○○○○○○○○○○○○○○●●○○○○○○○○○○○○●
●○○○○○○○○○○○○○○○○○○○○○○○○●●○○○○○○○○○○○○○●
●○○○○○○○○○○○○○○○○○○○○○○○●●○○○○○○○○○○○○○○●
●○○○○○○○○○○○○○○○○○○○○○○●●○○○○○○○○○○○○○○○●
●○○○○○○○○○○○○○○○○○○○○○●○○○○○○○○○○○○○○○○○●
●○○○○○○○○○○○○○○○○○○○○●○○○○○○○○○○○○○○○○○○●
●●●●●○○○○○○○○○○○○○○○●○○○○○○○○○○○○○○○●●●●●
●○○○○○○○○○○○○○○○○○○●○●○○○○○○○○○○○○○○○○○○●
●○○○○○○○○○○○○○○○○○○●○○●○○○○○○○○○○○○○○○○○●
●○○○○○○○○○○○○○○○○○●○○○○●●○○○○○○○○○○○○○○○●
●○○○○○○○○○○○○○○○○○●○○○○○●●○○○○○○○○○○○○○○●
●○○○○○○○○○○○○○○○○●○○○○○○○●●○○○○○○○○○○○○○●
●○○○○○○○○○○○○○○○●●○○○○○○○○●●○○○○○○○○○○○○●
●●○○○○○○○○○○○○○○●○○○○○○○○○○○●○○○○○○○○○○●●
●●○○○○○○○○○○○○○●○○○○○○○○○○○○○●○○○○○○○○○●●
●●●○○○○○○○○○○○○●○○○○○○○○○○○○○○●○○○○○○○●●●
●●●○○○○○○○○○○○●○○○○○○○○○○○○○○○○●○○○○○○●●●
●●●●○○○○○○○○○○●○○○○○○○○○○○○○○○○○●○○○○●●●●
●●●●○○○○○○○○○●○○○○○○○○○○○○○○○○○○○●●○○●●●●
●●●●●○○○○○○○●●○○○○○○○○○○○○○○○○○○○○●●●●●●●
●●●●●●○○○○○○○○○○○○○○○○○○○○○○○○○○○○○●●●●●●
●●●●●●●○○○○○○○○○○○○○○○○○○○○○○○○○○○●●●●●●●
●●●●●●●●○○○○○○○○○○○○●○○○○○○○○○○○○●●●●●●●●
●●●●●●●●●●○○○○○○○○○○●○○○○○○○○○○●●●●●●●●●●
●●●●●●●●●●●●○○○○○○○○●○○○○○○○○●●●●●●●●●●●●
●●●●●●●●●●●●●●○○○○○○●○○○○○○●●●●●●●●●●●●●●
●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

I could probably bring the score below 263 if I remove the second hand, but I like it!

Smiley faces like to be clocks too: http://jsfiddle.net/wBKQ6/17/show/light/

the fiddle isnt working...

@tryingToGetProgrammingStraight It's working for me in Chrome 30

im running firefox 24.0, just tried it in chrome - it worked, i can only change my vote if you edit...

Interesting. Didn't know that Chrome also implemented Explorer's proprietary innerText. Useful trick in this case.

Python, 328 - 65 = 263
Prints a new clock every second, with the minute hand updating every minute.
import math,time
def p(t,r):c[int(25-r*math.cos(t))][int(25+r*math.sin(t))]='*'
while 1:
 time.sleep(1);c=[[' ']*50 for i in range(50)];t=time.localtime();h=t.tm_hour*6.283+t.tm_min/9.549
 for i in range(999):
    p(i/158.0,24);p(h,i*.02);p(h/12,i*.01)
    for q in range(12):p(q/1.91,24-i*.005)
 for y in range(50):print''.join(c[y])

The clocks it prints look like this (it's not as stretched in my terminal):
                  **************
               ****      *     ****
             ***         *        ***
           ***           *          ***
          ** **          *         ** **
         **   *                    *   **
        **    **                  **    **
       *       *                  *      **
      **                                  **
     **                                    **
    **                                      **
    *                                        *
   ***                                      ***
   * ***                                  *** *
  **   **                                **   **
  *                                            *
  *                                            *
 **                                            **
 *                                              *
 *   *                                          *
 *   ******                                     *
 *        ******                                *
 *             ******                           *
 *                  *****                       *
 *****                   *                  ******
 *                       **                     *
 *                        **                    *
 *                         *                    *
 *                         **                   *
 *                          **                  *
 **                          **                **
  *                           *                *
  *                           *                *
  **   **                                **   **
   * ***                                  *** *
   ***                                      ***
    *                                        *
    **                                      **
     **                                    **
      **                                  **
       *       *                  *       *
        **    **                  **    **
         **   *                    *   **
          ** **          *         ** **
           ***           *          ***
             ***         *        ***
               ****      *     ****
                  **************
                         *

How does one read off the seconds?

One doesn't.  It prints every second but only updates every minute.

100% pure bash only! Without fork!
A finalized and upgraded version could be found there or on this page:
ascii-clock for geeks.
But don't use it! Read the note at end of this answer, you've been warned!
Use this perl version instead!
First simple clock without second tick.
Scalable and editable:
time 2>&1 /tmp/asci-art.sh 10 10 10
              . . . 12. . .
          11.               . 1
        .                       .
      .                           .
    .                               .
  10                                  2
  .     H                           M .
.                                       .
.                                       .
.                                       .
9                                       3
.                                       .
.                                       .
.                                       .
  .                                   .
  8                                   4
    .                               .
      .                           .
        .                       .
          7 .               . 5
              . . . 6 . . .

real    0m0.356s
user    0m0.348s
sys     0m0.004s

Draw a 21x21 (10x2+1) clock at 10H10 in less than one second.
This accept 3 arguments: Usage: ascii-clock.sh [ray of clock] [Hour] [Min] where default ray is 12, clock drawing is 2 x ray + 1 lines height and double width because of space added to try to obtain a round shape.
If the script is called with 0 or 1 argument, it will loop to redraw
each minute. Else if at least Hour (second param) is specified, It will draw
only once and exit.
The H marker is located at 70% of ray and
the M marker is located at 90% of ray.
No use of external binaries like date or bc for the draw!
(Thanks to @manatwork for the builtin read -t in place if /bin/sleep).
So all this is done by builtin shell commands.
It use ANSI sequence, but only for loop and to make markers bold.
#!/bin/bash
# Analog clock in Ascii-Art written in BASH V4.2 +=

RAY=${1:-12} NowH=$2 NowM=$3

sqrt() {
    local -a _xx=(600000 200000)
    local _x1=${_xx[$(($1&1))]} _x0=1
    while [ $_x0 -ne $_x1 ] ;do
        _x0=$_x1
        [ $_x0 -eq 0 ] && _x1=0000 ||
        printf -v _x1 "%u" $(( (${_x0}000 + ${1}00000000000/${_x0} )/2 ))
        printf -v _x1 "%.0f" ${_x1:0:${#_x1}-3}.${_x1:${#_x1}-3}
    done
    _x1=0000$_x1
    printf ${2+-v} $2 "%.3f" ${_x1:0:${#_x1}-4}.${_x1:${#_x1}-4}
}
clksin() { # $1:moment [0-60], $2:path length, $3:variable name
    local _csin=(0 104528 207912 309017 406737 500000 587785 669131
        743145 809017 866025 913545 951057 978148 994522 1000000)
    local xsign=1 x=$1 ysign=-1 y=$1
    [ $x -gt 30 ] && xsign=-1 x=$((60-x))
    [ $x -gt 15 ] && x=$((30-x))
    x=00000$((RAY*1000000+xsign*${2:-10}*${_csin[$x]}))
    [ $y -gt 30 ] && y=$((60-y))
    [ $y -gt 15 ] && ysign=1 y=$((30-y))
    y=00000$((RAY*1000000+ysign*${2:-10}*${_csin[15-$y]}))
    printf ${3+-v} $3 "%.0f %.0f" \
        ${y:0:${#y}-6}.${y:${#y}-6} ${x:0:${#x}-6}.${x:${#x}-6}
};

MLEN=000$((900*RAY))
printf -v MLEN "%.0f" ${MLEN:0:${#MLEN}-3}.${MLEN:${#MLEN}-3}
HLEN=000$((700*RAY))
printf -v HLEN "%.0f" ${HLEN:0:${#HLEN}-3}.${HLEN:${#HLEN}-3}

declare -A ticks
for ((i=1;i<=12;i++));do
    clksin $((5*(i%12))) $RAY tick
    ticks[$tick]=$i
done

while :;do
    [ "$NowM" ] || printf -v NowM "%(%M)T\n" -1
    clksin ${NowM#0} $MLEN NowM
    [ "$NowH" ] || printf -v NowH "%(%H)T\n" -1
    clksin $((5*(${NowH#0}%12))) $HLEN NowH

    [ "$2" ] || echo -en \\e[H; # ANSI sequence for top left of console
    for ((i=0;i<=2*RAY;i++));do
        x=$((RAY-i))
        sqrt $((RAY**2 - ${x#-}**2 )) y0
        printf -v y0 "%.0f" $y0
        for ((l=0;l<=2*RAY;l++));do
            y=$((RAY-l));
            sqrt $((RAY**2 - ${y#-}**2 )) x0
            printf -v x0 "%.0f" $x0
            if [ "${ticks["$i $l"]}" ] ;then
                printf "%-2s" ${ticks["$i $l"]}
            elif [ ${x#-} -eq $x0 ] || [ ${y#-} -eq $y0 ] ;then
                echo -n .\
            elif [ "$i $l" = "$NowM" ] ;then
                echo -en \\e[1mM\ \\e[0m
            elif [ "$i $l" = "$NowH" ] ;then
                echo -en \\e[1mH\ \\e[0m
            else
                echo -n \ \
            fi
        done
        echo -e \\e[K
    done
    echo -en \\e[J
    [ "$2" ] && break # Exit if at least Hour was specified
    printf -v SleepS "%(%S)T" -1
    read -t $((60-${SleepS#0})) foo
    unset NowH NowM
done

This could by run as:
for time in 10:10 15:00 12:30 06:00 09:15 16:40 ;do
    echo - $time -{,}{,}{,}
    ./ascii-clock.sh 5 ${time//:/ }
    echo -{,,,,,}{,}
  done |
    sed 's/\o033\[\(.m\|[JK]\)//g;/-$/!s/$/|/;s/-$/+/' |
    column -c 80

This will produce something like:
+- 10:10 - - - - - - - + - 12:30 - - - - - - - + - 09:15 - - - - - - - +
|      . . 12. .       |       . . 12. .       |       . . 12. .       |
|    11          1     |     11    H     1     |     11          1     |
|  10              2   |   10              2   |   10              2   |
|.   H           M   . | .                   . | .                   . |
|.                   . | .                   . | .                   . |
|9                   3 | 9                   3 | 9 H               M 3 |
|.                   . | .                   . | .                   . |
|.                   . | .                   . | .                   . |
|  8               4   |   8               4   |   8               4   |
|    7           5     |     7     M     5     |     7           5     |
|      . . 6 . .       |       . . 6 . .       |       . . 6 . .       |
+- - - - - - - - - - - + - - - - - - - - - - - + - - - - - - - - - - - +
+- 15:00 - - - - - - - + - 06:00 - - - - - - - + - 16:40 - - - - - - - +
|      . . 12. .       |       . . 12. .       |       . . 12. .       |
|    11    M     1     |     11    M     1     |     11          1     |
|  10              2   |   10              2   |   10              2   |
|.                   . | .                   . | .                   . |
|.                   . | .                   . | .                   . |
|9                 H 3 | 9                   3 | 9                   3 |
|.                   . | .                   . | .                   . |
|.                   . | .                   . | .   M           H   . |
|  8               4   |   8               4   |   8               4   |
|    7           5     |     7     H     5     |     7           5     |
|      . . 6 . .       |       . . 6 . .       |       . . 6 . .       |
+- - - - - - - - - - - + - - - - - - - - - - - + - - - - - - - - - - - +

Or could be run as:
xterm -geom 86x44 -bg black -fg grey -e ./ascii-clock.sh 21 &

xterm -geom 103x52 -fn nil2 -bg black -fg grey -e ./ascii-clock.sh 25 &

gnome-terminal --geometry 103x52 --zoom .5 -e "./ascii-clock.sh 25" &

Alternative: With full path drawing:
#!/bin/bash
# Analog clock in Ascii-Art written in BASH V4.2 +=

RAY=${1:-12} NowH=$2 NowM=$3

sqrt() {
    local -a _xx=(600000 200000)
    local _x1=${_xx[$(($1&1))]} _x0=1
    while [ $_x0 -ne $_x1 ] ;do
        _x0=$_x1
        [ $_x0 -eq 0 ] && _x1=0000 ||
    printf -v _x1 "%u" $(( (${_x0}000 + ${1}00000000000/${_x0} )/2 ))
        printf -v _x1 "%.0f" ${_x1:0:${#_x1}-3}.${_x1:${#_x1}-3}
    done
    _x1=0000$_x1
    printf ${2+-v} $2 "%.3f" ${_x1:0:${#_x1}-4}.${_x1:${#_x1}-4}
}
clksin() { # $1:moment [0-60], $2:path length, $3:variable name
    local _csin=(0 104528 207912 309017 406737 500000 587785 669131
    743145 809017 866025 913545 951057 978148 994522 1000000)
    local xsign=1 x=$1 ysign=-1 y=$1
    [ $x -gt 30 ] && xsign=-1 x=$((60-x))
    [ $x -gt 15 ] && x=$((30-x))
    x=00000$((RAY*1000000+xsign*${2:-10}*${_csin[$x]}))
    [ $y -gt 30 ] && y=$((60-y))
    [ $y -gt 15 ] && ysign=1 y=$((30-y))
    y=00000$((RAY*1000000+ysign*${2:-10}*${_csin[15-$y]}))
    printf ${3+-v} $3 "%.0f %.0f" \
    ${y:0:${#y}-6}.${y:${#y}-6} ${x:0:${#x}-6}.${x:${#x}-6}
};

MLEN=000$((900*RAY))
printf -v MLEN "%.0f" ${MLEN:0:${#MLEN}-3}.${MLEN:${#MLEN}-3}
HLEN=000$((700*RAY))
printf -v HLEN "%.0f" ${HLEN:0:${#HLEN}-3}.${HLEN:${#HLEN}-3}

declare -A ticks
for ((i=1;i<=12;i++));do
    clksin $((5*(i%12))) $RAY tick
    ticks[$tick]=$i
done

while :;do
    [ "$NowM" ] || printf -v NowM "%(%M)T\n" -1
    unset MPath
    declare -A MPath
    for ((i=1;i<=MLEN;i++));do
    clksin ${NowM#0} $i tick
    MPath[$tick]=M
    done
    [ "$NowH" ] || printf -v NowH "%(%H)T\n" -1
    unset HPath
    declare -A HPath
    for ((i=1;i<=HLEN;i++));do
    clksin $((5*(${NowH#0}%12))) $i tick
    HPath[$tick]=H
    done

    [ "$2" ] || echo -en \\e[H; # ANSI sequence for top left of console
    for ((i=0;i<=2*RAY;i++));do
    x=$((RAY-i))
    sqrt $((RAY**2 - ${x#-}**2 )) y0
    printf -v y0 "%.0f" $y0
    for ((l=0;l<=2*RAY;l++));do
        y=$((RAY-l));
        sqrt $((RAY**2 - ${y#-}**2 )) x0
        printf -v x0 "%.0f" $x0
        if [ "${MPath["$i $l"]}" ] ;then
        echo -en \\e[1m${MPath["$i $l"]}\ \\e[0m
        elif [ "${HPath["$i $l"]}" ] ;then
        echo -en \\e[1m${HPath["$i $l"]}\ \\e[0m
        elif [ "${ticks["$i $l"]}" ] ;then
        printf "%-2s" ${ticks["$i $l"]}
        elif [ ${x#-} -eq $x0 ] || [ ${y#-} -eq $y0 ] ;then
        echo -n .\
        else
        echo -n \ \
        fi
    done
    echo -e \\e[K
    done
    echo -en \\e[J
    [ "$2" ] && break # Exit if at least Hour was specified
    printf -v SleepS "%(%S)T" -1
    read -t $((60-${SleepS#0})) foo
    unset NowH NowM
done

could produce:
+- 10:10 - - - - - - - + - 12:30 - - - - - - - + - 09:15 - - - - - - - +
|      . . 12. .       |       . . 12. .       |       . . 12. .       |
|    11          1     |     11    H     1     |     11          1     |
|  10              2   |   10      H       2   |   10              2   |
|.   H           M   . | .         H         . | .                   . |
|.   H H H   M M M   . | .         H         . | .                   . |
|9                   3 | 9                   3 | 9 H H H H   M M M M 3 |
|.                   . | .         M         . | .                   . |
|.                   . | .         M         . | .                   . |
|  8               4   |   8       M       4   |   8               4   |
|    7           5     |     7     M     5     |     7           5     |
|      . . 6 . .       |       . . 6 . .       |       . . 6 . .       |
+- - - - - - - - - - - + - - - - - - - - - - - + - - - - - - - - - - - +
+- 15:00 - - - - - - - + - 06:00 - - - - - - - + - 16:40 - - - - - - - +
|      . . 12. .       |       . . 12. .       |       . . 12. .       |
|    11    M     1     |     11    M     1     |     11          1     |
|  10      M       2   |   10      M       2   |   10              2   |
|.         M         . | .         M         . | .                   . |
|.         M         . | .         M         . | .                   . |
|9           H H H H 3 | 9                   3 | 9                   3 |
|.                   . | .         H         . | .   M M M   H H H   . |
|.                   . | .         H         . | .   M           H   . |
|  8               4   |   8       H       4   |   8               4   |
|    7           5     |     7     H     5     |     7           5     |
|      . . 6 . .       |       . . 6 . .       |       . . 6 . .       |
+- - - - - - - - - - - + - - - - - - - - - - - + - - - - - - - - - - - +

or
                                . . . . 12. . . .
                          . . .                   . . .
                      . .                               . .
                  . 11                                      1 .
                .                                               .
              .                                                   .
            .                                                       .
          .                                                           .
        .                                                               .
      .                                                                   .
      10                                                                  2
    .                                                                   M   .
    .                                                             M M M     .
  .             H                                               M             .
  .               H H                                       M M               .
  .                   H                                   M                   .
.                       H H H                       M M M                       .
.                             H                   M                             .
.                               H H           M M                               .
.                                   H       M                                   .
9                                     H   M                                     3
.                                                                               .
.                                                                               .
.                                                                               .
.                                                                               .
  .                                                                           .
  .                                                                           .
  .                                                                           .
    .                                                                       .
    .                                                                       .
      8                                                                   4
      .                                                                   .
        .                                                               .
          .                                                           .
            .                                                       .
              .                                                   .
                .                                               .
                  . 7                                       5 .
                      . .                               . .
                          . . .                   . . .
                                . . . . 6 . . . .

Last version with Seconds ticks rendering and nanosleep to sync.
This work only on recent Linux, as this use /proc/timer_list to compute fraction of second to sleep between each refresh.
#!/bin/bash
# Analog clock in Ascii-Art written in BASH V4.2 +=

RAY=${1:-12} NowH=$2 NowM=$3

# Hires Sleep Until
# there is a need to store offset in a static var

mapfile  </proc/timer_list _timer_list
for ((_i=0;_i<${#_timer_list[@]};_i++));do
    [[ ${_timer_list[_i]} =~ ^now ]] && TIMER_LIST_SKIP=$_i
    [[ ${_timer_list[_i]} =~ offset:.*[1-9] ]] && \
        TIMER_LIST_OFFSET=${_timer_list[_i]//[a-z.: ]} && \
        break
done
unset _i _timer_list
readonly TIMER_LIST_OFFSET TIMER_LIST_SKIP

sleepUntilHires() {
    local slp tzoff now quiet=false nsnow nsslp
    local hms=(${1//:/ })
    mapfile -n 1 -s $TIMER_LIST_SKIP nsnow </proc/timer_list
    printf -v now '%(%s)T' -1
    printf -v tzoff '%(%z)T\n' $now
    nsnow=$((${nsnow//[a-z ]}+TIMER_LIST_OFFSET))
    nsslp=$((2000000000-10#${nsnow:${#nsnow}-9}))
    tzoff=$((0${tzoff:0:1}(3600*${tzoff:1:2}+60*${tzoff:3:2})))
    slp=$(( ( 86400 + ( now - now%86400 ) +
                10#$hms*3600+10#${hms[1]}*60+10#${hms[2]} -
                tzoff - now - 1
            ) % 86400)).${nsslp:1}
    read -t $slp foo
}

sqrt() {
    local -a _xx=(600000 200000)
    local _x1=${_xx[$(($1&1))]} _x0=1
    while [ $_x0 -ne $_x1 ] ;do
        _x0=$_x1
        [ $_x0 -eq 0 ] && _x1=0000 ||
    printf -v _x1 "%u" $(( (${_x0}000 + ${1}00000000000/${_x0} )/2 ))
        printf -v _x1 "%.0f" ${_x1:0:${#_x1}-3}.${_x1:${#_x1}-3}
    done
    _x1=0000$_x1
    printf ${2+-v} $2 "%.3f" ${_x1:0:${#_x1}-4}.${_x1:${#_x1}-4}
}
clksin() { # $1:moment [0-60], $2:path length, $3:variable name
    local _csin=(0 104528 207912 309017 406737 500000 587785 669131
    743145 809017 866025 913545 951057 978148 994522 1000000)
    local xsign=1 x=$1 ysign=-1 y=$1
    [ $x -gt 30 ] && xsign=-1 x=$((60-x))
    [ $x -gt 15 ] && x=$((30-x))
    x=00000$((RAY*1000000+xsign*${2:-10}*${_csin[$x]}))
    [ $y -gt 30 ] && y=$((60-y))
    [ $y -gt 15 ] && ysign=1 y=$((30-y))
    y=00000$((RAY*1000000+ysign*${2:-10}*${_csin[15-$y]}))
    printf ${3+-v} $3 "%.0f %.0f" \
    ${y:0:${#y}-6}.${y:${#y}-6} ${x:0:${#x}-6}.${x:${#x}-6}
};

SLEN=000$((870*RAY))
printf -v SLEN "%.0f" ${SLEN:0:${#SLEN}-3}.${SLEN:${#SLEN}-3}
MLEN=000$((780*RAY))
printf -v MLEN "%.0f" ${MLEN:0:${#MLEN}-3}.${MLEN:${#MLEN}-3}
HLEN=000$((650*RAY))
printf -v HLEN "%.0f" ${HLEN:0:${#HLEN}-3}.${HLEN:${#HLEN}-3}

declare -A ticks
for ((i=1;i<=12;i++));do
    clksin $((5*(i%12))) $RAY tick
    ticks[$tick]=$i
done

while :;do
    [ "$NowM" ] || printf -v NowM "%(%M)T\n" -1
    unset MPath
    declare -A MPath
    for ((i=1;i<=MLEN;i++));do
    clksin ${NowM#0} $i tick
    MPath[$tick]=M
    done
    [ "$NowH" ] || printf -v NowH "%(%H)T\n" -1
    unset HPath
    declare -A HPath
    for ((i=1;i<=HLEN;i++));do
    clksin $((5*(${NowH#0}%12))) $i tick
    HPath[$tick]=H
    done
    printf -v NowS "%(%S)T\n" -1
    clksin ${NowS#0} $SLEN STick

    [ "$2" ] || echo -en \\e[H; # ANSI sequence for top left of console
    for ((i=0;i<=2*RAY;i++));do
    x=$((RAY-i))
    sqrt $((RAY**2 - ${x#-}**2 )) y0
    printf -v y0 "%.0f" $y0
    for ((l=0;l<=2*RAY;l++));do
        y=$((RAY-l));
        sqrt $((RAY**2 - ${y#-}**2 )) x0
        printf -v x0 "%.0f" $x0
        if [ "$i $l" = "$STick" ] ;then
                echo -en \\e[1ms\ \\e[0m
        elif [ "${MPath["$i $l"]}" ] ;then
        echo -en \\e[1m${MPath["$i $l"]}\ \\e[0m
        elif [ "${HPath["$i $l"]}" ] ;then
        echo -en \\e[1m${HPath["$i $l"]}\ \\e[0m
        elif [ "${ticks["$i $l"]}" ] ;then
        printf "%-2s" ${ticks["$i $l"]}
        elif [ ${x#-} -eq $x0 ] || [ ${y#-} -eq $y0 ] ;then
        echo -n .\
        else
        echo -n \ \
        fi
    done
    echo -e \\e[K
    done
    echo -en \\e[J
    [ "$2" ] && break # Exit if at least Hour was specified
    printf -v SleepS "%(%s)T" -1
    printf -v SleepS "%(%T)T" $((1+SleepS))
    sleepUntilHires $SleepS
    unset NowH NowM
done

More obfuscated version (2702 bytes):
As requested by @manatwork, there is a more golfed version.
This version is colorized and present digital time on corners.
#!/bin/bash
W=/proc;J=${1:-12} B=$2 A=$3 LANG=C R=$W/timer_list;if [ -f $R ];then Q=10
mapfile <$R e;for ((P=0;P<${#e[@]};P++));do ((Q+=${#e[P]}));[[ ${e[P]} =~ ^now
]]&&U=$Q;[[ ${e[P]} =~ offset:.*[1-9] ]]&&a=${e[P]//[a-z.: ]}&&break;done;c(){
local q p;read -N$U q <$R;q=${q%% nse*};q=$[${q##* }+a];p=$[2000000000-10#${q:
${#q}-9}];read -t .${p:1} M;};else c(){ local H;read -d\  H < $W/upti*;H=$[200
-10#${H#*.}];read -t .${H:1} M;};fi;u(){ local E=({6,2}00000) F=${E[$1&1]} G=1
while [ $G -ne $F ];do G=$F;[ $G -eq 0 ]&&F=0000||printf -v F "%u" $(((${G}000
+${1}00000000000/${G})/2));printf -v F "%.0f" ${F:0:${#F}-3}.${F:${#F}-3};done
F=0000$F;printf -v $2 "%.3f" ${F:0:${#F}-4}.${F:${#F}-4};};g(){ local t=($[7#0
] 104528 207912 309017 406737 500000 587785 669131 743145 809017 866025 913545
951057 978148 994522 1000000) j=1 x=$1 h=-1 y=$1;[ $x -gt 30 ]&&j=-1 x=$[60-x]
((x>15))&&x=$[30-x];x=00000$[J*1000000+j*${2:-10}*${t[$x]}];((y>30))&&y=$[60-y
];((y>15))&&h=1 y=$[30-y];y=00000$[J*1000000+h*${2:-10}*${t[15-y]}];printf -v\
$3 "%.0f %.0f" ${y:0:${#y}-6}.${y:${#y}-6} ${x:0:${#x}-6}.${x:${#x}-6};};v=000
v+=$((870 *J));printf -v v "%.0f" ${v:0:${#v}-3}.${v:${#v}-3};C=000$((780*J));
printf -v C "%.0f" ${C:0:${#C}-3}.${C:${#C}-3};D=000$[650*J];printf -v D %.f \
${D:0:${#D}-3}.${D:${#D}-3};declare -A m;for ((i=1;i<=12;i++));do g $[5*(i%12)
] $J w;m[$w]=$i;done;printf -v T "\e[1m%s\e[0m " . + \* o O;T=(${T});m["${J: \
} $J"]=${T} ;printf "\e[?25l\e[H\e[J";trap "printf '\e[?12l\e[?25h\e[$((2*J +3
))H\e[J';exit" 0 1 2 3 6 9 15; printf -v S "\\e[1;%dH%%(%%H)T\\e[%dH%%(%%M${Z:
})T\\e[%d;%dH%%(%%S)T" $[4*J] $[2*J+1] $[2*J+1] $[4*J];declare -A V;V["$[2 * J
] $[2*$J]"]="  ";while :;do [ "$A" ]||printf -v A "%(%M)T" -1;unset r;declare\
 -A r;for ((i=1;i<=C;i++));do g ${A#0} $i w;r[$w]=M;done;[ "$B" ]||printf -v \
B "%(%H)T" -1;unset s;declare -A s;for ((i=1;i<=D;i++));do g $((5*( ${B#0}%12)
)) $i w;s[$w]=H;done;printf -v z "%(%S)T" -1;g ${z#0} $v n;[ "$2" ]||echo -en\
 \\e[H;for ((i=0;i<=2*J;i++));do x=$[J-i];u $[J*J-${x#-}**2] N;printf -v N${Z:
} %.f $N;for ((l=0;l<=2*J;l++));do y=$[J-l];u $[J*J-${y#-}**2] O;printf -v O \
%.f $O;c="  ";if [ "$i $l" = "$n" ];then c=$'\e[36;1ms \e[m';elif [ "${r["${i:
} $l"]}" ] ;then c=$'\e[32;1m'${r["$i $l"]}$' \e[0m';elif [ "${s["$i $l"]}" ];
then c=$'\e[34;1m'${s["$i $l"]}$' \e[0m';elif [ "${m["$i $l"]}" ];then printf\
 -v c "%-2s" "${m["$i $l"]}";elif [ ${x#-} -eq $O ] || [ ${y#-} -eq $N ] ;then
c=.\ ;else c="  ";fi;[ "$c" != "${V["$i $l"]}" ]&& V["$i $l"]="$c" && printf \
"\e[%s;%sH%-2s" $((1+i)) $[1+l*2] "$c";done;done;[ "$2" ] &&break;printf "${Z:
}\e[H\e[7mS\e[0m";c;printf "\e[H $S" -1 -1 -1;m["$J $J"]=${T[$[10#$z%${#T[@]}]
]};unset B A;done

Note: Don't use this anyway!
As this is bash programm and as bash is not a programmation language, this is not well to use for a while.
There is a little demo of memory consumption in only 5 hours, with a drawing of 7 character length ray:
$ ascii-clock.sh 7

After     PMem   PCpu      Mem
    0'30"  0.0%  21.6%   12.98M
   10'30"  1.0%  20.9%   48.91M
 1h 0'30"  5.6%  20.8%  228.63M
 2h 0'31" 11.2%  20.8%  444.25M
 3h 0'32" 16.8%  20.8%  659.91M
 5h 0'00" 27.9%  20.8%   1.064G

The main advantage of this that when I need memory, I just have to kill the clock.
( Nota: I've merged this, the perl version and a javascript version of same on ascii-clock for geeks ;-)

@manatwork Why? It's analog, run continuously and make the draw in less than 1 second... What do I mis readed?

Oops. My mistake. First I tried it on bash 4.1. On 4.2 indeed runs continuously and not requires the command line parameters.

There is no size limit on requirement. And doing this in pure bash is a real challenge! Doing this shorther without fork seem not simple (if even possible).

Right, there is no size limit and accomplishing it with pure bash is a demonstration of great skill. (/me takes of his hat and clicks the upvote link) But those 2529 characters could still be reduced in the spirit of [tag:code-golf] challenges: “Code-golf is a competition to solve a particular problem in the fewest bytes of source code.”

@manatwork There is now a more golfed version, (not shorter: from 2529bytes, this version is now 2702 bytes, but has new features)

Python 2 - 207
import time as T
while 1:t=T.localtime();m=t.tm_min/5;l=[12]+range(1,12);l[m]='';l[t.tm_hour%12]='H';l[m]+='M';a='  %s\n';print(a+('%s'+a)*5+a)%tuple(str(l[x])for x in[0,11,1,10,2,9,3,8,4,7,5,6]);T.sleep(9)

It is very ugly, but readable. Prints every 9 sec (you can change to 1 sec if you prefer), updates every 5 min. I don't have much experience with code golfing in python so I expect it can be improved.
Example output:
  12
11  1
10  2
9  M
8  4
7  H
  6

Your clock appears to be a Dali. Bravo!

Perl 5 x 65 = 325 - 65(20%) = 260 chars!!
Clean, circular, with a second tick and updated every seconds.
perl -E '
$r=11;$p=atan2(1,1)/7.5;sub c{($A,$R,$C)=@_;$a[$r-$R*cos($A*$p)][
$r+$R*sin($A*$p)]=$C." "x($C!~/../)};while(::){@a=map{[map{"  "}(
0..$r*2)]}(0..$r*2);map{c$_*5,$r,$_}(1..12);@t=localtime;for$i(qw
|H:6:5:2 M:8:1:1 s:9:1:0 |){($S,$P,$F,$T)=split":",$i;map{c$F*$t[
$T],$_,$S}(do{$T?1:$P}/10*$r..$P/10*$r)};map{say@{$_}}@a;sleep 1}
'

On a 24 lines console look good (It's 00:12:56):
                    12
          11                    1
                s

  10                  H                 2
                      H
                      H
                      H           M M
                      H     M M M
                      M M M
9                                           3

  8                                     4

          7                     5

                      6

And there is a colored, nicer and smarter version:
#!                               /usr/bin/perl
                        use Time::HiRes qw|sleep time|
                     ;$h=11;$h=$ARGV[0]if$ARGV[0];$P=atan2
                 (1,1)/7.5;$V =4*$h; $v= 2* $h+ 1;@r=(0..2*$v)
              ;sub p{printf @_       }sub        b{ return"\e[1m"
            .pop."\e[0m"              };$              |=p"\e[?25".
           "l\e[H\e[" ."J"            ;$             SIG{ 'INT'}=sub
         {p"\e[?1"    ."2l"                        ."\e"     ."[?25h".
      "\e[%dH"        ."\e"                       ."[J"      ,$v+2;exit;
      };@z=map                                                  {[map{" "
     }@r] }(0                                                     ..2*$v);
    @Z=map{[@                                                  {$z[$_]}]}@r
   ;sub c{($A,$r ,$s                                       )=@_;$z[$h-$r*cos
  ($A*$P)    +.5 ][$h+$                                 r*sin($A*$P)+.5]=$s;}
  for$x(        0..$h) {$y=                         int(sqrt($h**2     -$x**2
 )+.5);$         z[$h-$x][$h-$                  y]=".";$z[$h+$x        ][$h-$y
 ]=".";             $z[$h-$x][$h+$           y]=".";$z[$h+$x            ][$h+$
y]=".";                $z[$h-$y][$h-$    x]=".";$z[$h+$y                ][$h-$x
]=".";                    $z[$h-$y][$h+$x]=".";$z[$h+                    $y][$h
+$x]="."};map{               c$_*5,$h,b$_}(1..12);                @R=map{[@{$z[
$_]}]}@r;while                (::){@t=localtime;                   p"\e[H\e[1;$
{V}H%0"                       ."2d\e[${v}H%02d\e"                        ."[${v
};${ V                         }H%02d",$t[2],$t[                         1],$t[
 0];@z=                         map{[     @{$R[                         $_]}]}(
 0..2*$                                                                 v);for
 $i('H:'                                                              .'65:5:'
  .'2:4',     ""                                               x1    .'M:78:'
   ."1:1" .":2",                                               "s:8". "7:1:"
    .'0:6'){($                                                  l,$p,$F,$u,$
     c)=split                                                    ":",$i;map
      {c$F*$t                                                     [$u],$_
       ,b("\e["                                                ."3${c}m$
        l")}(do{$u     ?1:$                         p} /     100*$h..$p
          /100*$h);}  $z[$            h][            $h]=  b((".","+"
            ,"*","o","O")             [$t             [0]%5]);for$x
              (@r){for$y(@r           ){$           Z[$x][$y]ne$z
                 [$x][$y]?p"\e[%d;%dH".$z  [ $x] [$y],$x+1,2*$
                    y+1:''};};@Z=map{[@{$z[$_]}]}@r;$n=1-$1
                        if time=~/(\..*)$/;p"\e[H\e[7m"
                               ."S\e[0m";sleep$n}

This version is strongly linked to this other answer, with the main advantage: You could run this quietly, for a while!
So you could find an upgraded version there or on this ascii-clock for geeks web page.
As a demonstration that doing approx same in perl require less resources:
$ ascii-clock.pl 7

After     PMem   PCpu      Mem
    0' 0"  0.0%   0.0%    23.5M
   10'30"  0.0%   0.0%    23.5M
 1h 0' 0"  0.0%   0.0%    23.5M
 2h 0' 0"  0.0%   0.0%    23.5M

for approx same features:

wait for begin of each seconds for doing a refresh
draw with color and bold attributes
draw full circle with dots, hour tick, hour and minutes full path and a s dot for second handler.
draw digital clock prompting hour at top right, minutes at bottom left and seconds at bottom right.
prompt a S at top left, when sleeping (look for difference with bash version)

Plus

The upgraded version authorize -a argument for drawing hour and minute path in fraction (11h59 place hour path approx at 12h).

One more another perl version!!!
Using the following (beautiful) picture:

You could simply:
curl https://i.stack.imgur.com/xvbHP.png |
  perl -e 'use GD;GD::Image->trueColor(1);$i=GD::Image->newFromPng(
      STDIN);my($x,$y)=$i->getBounds();for my$k(0..$x-1){for my$l(0
      ..$y-1){$_.=pack"UUU",$i->rgb($i->getPixel($k,$l))};};eval'

or, with arguments (You have to add -s switch to perl command):
wget -O - http://fhauri.cartou.ch/ascii-clock/ascii-clock.png |
  perl -se 'use GD;GD::Image->trueColor(1);$i=GD::Image->newFromPng(
      STDIN);my($x,$y)=$i->getBounds();for my$k(0..$x-1){for my$l(0
      ..$y-1){$_.=pack"UUU",$i->rgb($i->getPixel($k,$l))};};eval' -- -a 18

This require having gd2-perl installed! (You could replace curl by wget -O - ;-)
( Note: This picture is near 1.5Kb. I've built another same picture, but 900 bytes length. You may find this picture, well as a javascript version of same at ascii-clock for geeks :-)

In last sample, I (strongly recommend/) suggest to replace eval by print in order before running unknown downloaded code ;-)

Tcl, 288
while 1 {scan [clock format [clock seconds] -format %k-%M] %d-%d h m
regsub -all \ +|. "oaosocowoeouooovoioxozom   r    n\n" \ {&} p
lset p [set h [expr $h%12*2]] h
lset p [set m [expr $m/5*2]] [expr $h-$m?"m":"x"]
puts [string map /\ $p {rr/nrzmrann xrrr snnimrrrcnn vrrr wnnromrenrru}]}

Ok, here some explaination:

while 1 {...} - Ok, forget the explaination.
regsub -all \ +|. "oaosocowoeouooovoioxozom   r    n\n" \ {&} p replaces +|. with _{\0} and stores the result in p. p is actually a messed up dictionary where the first key is missing (or just a list with an odd number of elements).
lset p [set h [expr $h%12*2]] h sets the hour in the replacement list
lset p [set m [expr $m/5*2]] [expr $h-$m?"m":"x"] sets the minute. if hour and minute is the same, use x instead.
string map /\ $p {rr/nrzmrann xrrr snnimrrrcnn vrrr wnnromrenrru} /\ $p is equal to "/ $p", so I add the first key (/). After that I replace every occurence of a key in rr/nrzmrann xrrr snnimrrrcnn vrrr wnnromrenrru with it's value.

The usual map is
/ o a o s o c o w o e o u o o o v o i o x o z o m {   } r {    } n {
}

(Read as "Replace / with o, replace a with o... replace m with ___ (that should be spaces))
I repace an o with h and an other with m, m, r and n are just to shoren the output string (I replaced several spaces with one of them, also \n with n). I add the first element later so I can use h*2 instead h*2+1 for the index that I replace. (saves 2 chars)
Some notes:

A list in Tcl uses whitespace as delimiter, if an element contains whilespace, you have to enclose it with {}. Ok, it's a little bit more complex e.g. you could escape the whitespace with a \, but such details are documented somewhere else.
A dict in Tcl is just a list with an even number of elements: key1 value1 key2 value2
You can treat a list as string or a string as list. Will work if the string is a valid list. Free serialization!

When it is 14:23, it displays wrongly the hour pointer on 13:00 instead of 14:00! — http://www.tutorialspoint.com/execute_tcl_online.php?PID=0Bw_CjBb95KQMcEpYY3RnT09zb2c

Well, Tcl knows about timezones. Setup your environment correctly. (looks like tutorialspoints uses UTC)

Oops, sorry. May be I am in a different time setup. Here it is Portugal, we use GMT, and being in the summer, hour is +1. So, get my upvote.

Javascript 2169 - 434 = 1735
Ok, it's a lot, but they are fine and work same as my previous variant in previous posts (bash and perl).
This version is more obfuscated than the one you may find on my  ascii-clock for geeks

var x='<div class="m"> M</div>',v='<div class="s"> s</div>',w=' '
,r=10,q,w=' ',y='<div class="h"> H</div>',f=new Object();function d(){
q=document.getElementById("asciiclock");var t=document.location.toString().match
(/[?]([0-9]+)/);if (t!=null) r=t[1]*1.0;a();b();}function m(e){r=e;a();}function
a(){f=[];for (var i=1;r>i;i++){var u=Math.round(Math.sqrt(Math.pow(r,2)-Math.pow
(r-i,2)));f[(2*r-i)+"x"+(r+u)]=w+".";f[(i)+"x"+(r+u)]=w+".";f[(2*r-i)+"x"+(r-u)]
=w+".";f[(i)+"x"+(r-u)]=w+".";f[(r+u)+"x"+(2*r-i)]=w+".";f[(r+u)+"x"+(i)]=w+".";
f[(r-u)+"x"+(2*r-i)]=w+".";f[(r-u)+"x"+(i)]=w+".";}for(var i=1;13>i;i++){f[Math.
round(r+r*Math.sin(Math.PI/6*i-Math.PI/2))+"x"+Math.round(r+r*Math.cos(Math.PI/6
*i-Math.PI/2))]='<div class="t">'+(i<10?w+i:i)+'</div>';}}function b(){var z='';
var s=new Date(), o=s.getMinutes()*1.0+1.0*s.getSeconds()/60,p=s.getHours()*1.0+
1.0*o/60,n=s.getSeconds()*1.0,k=s.getHours();if (k<10) k=w+k;var j=s.getMinutes(
);if (j<10) j=w+j;var h=s.getSeconds();if (h<10)h=w+h;var g=new Object();for(var
i=1;r*.78>=i;i++) {g[Math.round(r+i*Math.sin (Math.PI/30*o-Math.PI/2))+"x"+Math.
round(r+i*Math.cos(Math.PI/30*o-Math.PI/2))]=x;};for (var i=1;r*.62 >=i;i++) {g[
Math.round(r+i*Math.sin(Math.PI/6*p-Math.PI/2))+"x"+Math.round(r+i*Math.cos(Math
.PI/6*p-Math.PI/2))]=y;};g[Math.round(r+.87*r*Math.sin(Math.PI/30*n-Math.PI/2))+
"x"+Math.round(r+.87*r*Math.cos(Math.PI/30*n-Math.PI/2))]=v;for (var i=0;2*r>=i;
i++){for(var l=0;2*r>=l;l++){if((i==r)&&(l==i)){z+=w+'<div class="t">'+['.','+',
'*','o','O'][n%5]+'</div>';}else if(f[i+"x"+l]!=undefined){z+=f[i+"x"+l]}else if
(g[i+"x"+l]!=undefined){z+=g[i+"x"+l];}else if(l==2*r){if(i==0){z+=w+'<div clas'
+'s="t">'+k+'</div>';}else if(i==l){z+=w+'<div class="t">'+h+'</div>';}else{z+=w
+w;};}else if(l==0){if(i==2*r){z+='<div class="t">'+j+'</div>';}else if(i==0){z=
'<div class="r">S</div>'+w;}else{z+=w+w}}else{z+=w+w}};z+='<br />';};q.innerHTML
=z;window.setTimeout(b,1000-new Date().getMilliseconds());};function c(){window.
setTimeout(b,0);q.innerHTML=w+q.innerHTML.substring (22);q.setAttribute('style',
'display:none');q.setAttribute('style',null)};window.onload=d;
.asciiclock { margin: 3em 0px 0px 0px;padding: 2px 4px 2px 3px; font-size: .5em;
display:inline-block;font-family:mono,monospace,courier;background:rgba(0,0,0,.7
);color: #888;}.asciiclock div{ display:inline-block;font-weight:bold;}.h{color:
#46F;}.m{color:#0F0;}.s{color:#0FF;}.r{color:#000;background:#aaa;}.t{color:#aaa
;}pre{display:inline-block;}
<head><title>Ascii-clock</title><script type="text/javascript" src="ascii-clock.js"
></script><link rel="stylesheet" href="ascii-clock.css" type="text/css"><style
type="text/css">body{margin:0;padding:0;background:#000;}.asciiclock{margin:0}
</style></head><body><div id="asciiclock" class="asciiclock"></div></body>

Ruby: 230 228 characters - 46 = 182
M=Math
P=M::PI
x=->n,m=60,r,c{$><<"^[[%d;%dH%s\n"%[M.sin(n*P*2/m-P/2)*r+12,M.cos(n*P*2/m-P/2)*r*2+24,c]}
while t=Time.now
$><<"^[[2J"
1.upto(12){|i|x[i,12,11,i]}
x[t.hour*5+t.min/12,8,?H]
x[t.min,9,?M]
x[t.sec,10,?S]
sleep 0.1
end

(Note: ^[ is a single character.)
Sample run (at 21:19:33):
                      12
           11                     1

   10                                     2

       H
 9                                           3

                                       M

   8                                      4

            7   S                 5

                       6

“As ugly as you wish” version: 191 181 characters - 36 = 145
(Smaller size, lower precision, no seconds, identical radius, horrible flickering.)
x=->n,m=60,c{$><<"^[[%d;%dH%s\n"%[Math.sin(n*6.3/m-1.6)*8+9,Math.cos(n*6.3/m-1.6)*8+9,c]}
while t=Time.now
$><<"^[[2J"
1.upto(12){|i|x[i,12,i]}
x[t.hour*5+t.min/12,?H]
x[t.min,?M]
end

Sample run (at 21:19):
       12  1
   11

              2
 10

H              3
9

               M
 8

            5
    7   6

Trigonometry-less version: 130 125 characters (no bonus)
(Inspired by Johannes Kuhn's Tcl solution. Not sure how much, as I still not deciphered his code.)
while t=Time.now
puts"^[[2J  k l a
j\tb
i\tc
h\td
  g f e".tr((t.min/5+96).chr,?M).tr(((t.hour-1)%12+97).chr,?H).tr("a-l",?*)
end

Sample run (at 21:19):
  * * *
*       *
H       M
*       *
  * * *

I added an explanation to my solution. Just ask if something is not clear.

Thank you @JohannesKuhn, I already read it. For me the mystery is not the syntax, but the encoding of those string values.

On that last one I'm getting syntax errors.

@Timtech, is it “tr': can't convert Fixnum into String (TypeError)”? Now that you mentioned the error I dug for a version 1.8.7 and received the above error of that. Works fine on 1.9.2 and 1.9.3. Seems that ?M` was interpreted as Fixnum in older versions and only later was changed to String.

Python, 259 - 52 = 207
from time import*
from math import*
g=[[' ']*61 for _ in[0]*31]
while 1:
 t=localtime()
 for x in range(60):a=pi*x/30-pi/2;g[15+int(15*sin(a))][30+int(30*cos(a))]='m'if x==t.tm_min else'h'if x==t.tm_hour%12*5 else'-'if x%5 else'#'
 for r in g:print''.join(r)

Sample output:
                              #
                     -  -  -     -  -  -
                  -                       -
             -  h                           #  -
          -                                       -
        -                                           -

      m                                               -
     #                                                 #
   -                                                     -

  -                                                       -
 -                                                         -

 -                                                         -
#                                                           #
 -                                                         -

 -                                                         -
  -                                                       -

   -                                                     -
     #                                                 #
      -                                               -

        -                                           -
          -                                       -
             -  #                           #  -
                  -                       -
                     -  -  -     -  -  -
                              #

HTML & JS: 397 - 20% = 317.6 characters
My first iteration. I'm not very pleased with it, but it does work and it does show the time in a very clear way.
<canvas id=c width=198 height=198></canvas><script>c=document.getElementById("c")
.getContext("2d");c.r=c.rotate;c.c=c.clearRect;c.translate(99,99);for(i=0;i<60;i++)
{c.fillRect(89,-1,i%5?3:9,5);c.r(p=Math.PI/30);}setInterval(function(){n=new Date();
h=n.getHours()*5*p;c.beginPath();c.arc(0,0,86,0,7);c.fill();c.r(m=n.getMinutes()*p);
c.c(-2,-3,4,-80);c.r(h-m);c.c(-2,-3,4,-50);c.r(-h);},5);</script>

Cute, but not exactly what we call [tag:ascii-art].

Ti-Basic 84, 587 - 20% = 469.6
:Xmax/2→Xmax:Ymax/2→Ymax:-Xmax→Xmin:-Ymax→Ymin:Degree:15→H:20→M:18→S::Circle(0,0,30):For(X,1,12)::Text(28-int(cos(X*30)*25),46+int(sin(30*X)*25),X):End:{0,0,0}→LANG:While getKey=0::getTime→LTIME::If LTIME(3)≠LANG(3)/6:Line(0,0,sin(LANG(3))*S,cos(LANG(3))*S,0)::If LTIME(2)≠LANG(2)/6:Then:::Line(0,0,sin(LANG(2))*M,cos(LANG(2))*M,0):::Line(0,0,sin(LANG(1))*H,cos(LANG(1))*H,0)::End::"SET ANGS::LTIME(1)*30+LTIME(2)/2→LANG(1)::LTIME(2)*6→LANG(2)::LTIME(3)*6→LANG(3)::Line(0,0,sin(LANG(1))*H,cos(LANG(1))*H::Line(0,0,sin(LANG(2))*M,cos(LANG(2))*M::Line(0,0,sin(LANG(3))*S,cos(LANG(3))*S:End

Its output is very pretty and detailed.

C, 554 Bytes, Updates roughly once per second.
#include <time.h>
#include <math.h>
int r=25,i,q,c,i,q,b[999];void v(float a,int f,int m){b[(r/2+(int)(sin(a)*f))*r+r/2+(int)(cos(a)*f)]=m;}void main(){float a,p=6.28,z=1.57,h,m,s;for(;;){time_t u=time(0);struct tm*l=localtime(&u);s=l->tm_sec;m=l->tm_min+s/60.;h=l->tm_hour+m/60.;system("@cls||clear");q=r*r;c=r/2;memset(b,32,q*4);for(i=0,a=p;a>0;a-=0.52,i++)v(a,c,i%3?46:i%6?124:45);v(0,0,79);v(p*s/60.-z,c-4,83);v(p*m/60.-z,c-5,77);v(p*h/12.-z,c-6,72);for(i=0;i<q;i++){c=b[i];putchar(c);if(i%r==r-1)putchar(10);}for(c=0;c<2000000;c++)hypot(3,.4);}}

Result:
           |
      .          .

 .
                S    .

       H

-          O          -

                M
 .
                     .

     .          .
           |

449 bytes


text:
Build a program with one simple GOTO

Your task is to build the largest program you can that uses exactly one GOTO, without which the entire program (or at least a huge chunk of it) must be completely restructured. The score is counted as the number of statements in your code that change places or are newly introduced (removing statements doesn't add to your score) when the code is restructured without the GOTO (others are allowed to challenge your restructuring by presenting a more elegant one). As this is code bowling, highest score wins.
Note: I do not claim any liability for velociraptor attacks by attempting this challenge.

The one single goto seems problematic. Every C code I can think of that uses a single goto can be trivially changed to use structured constructs. Multiple gotos however...

@Pubby's claim seems to hold against the current two solutions. Replacing goto with switch seems possible for both.

@Pubby How many goto's would you need to create a workable solution? If the problem as currently stated is impossible, I can create an alternative problem.

I think you're allowed to embed the cartoon, as long as there's a link too.

It doesn't qualify, but I really did this.

Use ASM where you can't even remove the GOTO

Voting to close as it is unclear what is meant by "completely restructured", and as most languages allow any program to be restructured to a single statement, the scoring criterion is also hard to define a quantitative limit for.

C fizzbuzz
This solution runs around the idea of interrupts and label variables (gcc only, sorry). The program sets up a timer which periodically calls main, where we goto whichever place the last execution of our interrupt handler (main) told us we should.
I've never used timers or label variables before, so I think there is much to bowl here.
#include <sys/time.h>
#include <signal.h>
#include <stdio.h>

int main(int argc)
{
    static int run = 1;
    static int* gotoloc = &&init;
    static int num = 0;
    static int limit = 50;

    goto *gotoloc;
init:
    signal(SIGVTALRM, (void (*)(int)) main);
    gotoloc = &&loop;

    struct itimerval it_val;

    it_val.it_value.tv_sec = 0;
    it_val.it_value.tv_usec = 100000;
    it_val.it_interval.tv_sec = 0;
    it_val.it_interval.tv_usec = 100000;
    setitimer(ITIMER_VIRTUAL, &it_val, NULL);

    while(run);

loop:
    num = num + 1;
    run = num < limit;
    gotoloc = &&notfizz + (&&fizz - &&notfizz) * !(num % 3);
    return 1;

fizz:
    printf("fizz");
    gotoloc = &&notbuzz + (&&buzz - &&notbuzz) * !(num % 5);
    return 1;

notfizz:
    gotoloc = &&notfizzbuzz + (&&buzz - &&notfizzbuzz) * !(num % 5);
    return 1;

buzz:
    printf("buzz\n");
    gotoloc = &&loop;
    return 1;

notbuzz:
    printf("\n");
    gotoloc = &&loop;
    return 1;

notfizzbuzz:
    printf("%d\n", num);
    gotoloc = &&loop;
    return 1;
}

run should be declared volatile, otherwise while(run) can be "optimized" to while(1). Or instead, just goto somewhere that calls exit.

@ugoren Good point. I turned on optimizations (O1, O2 and Os) and all those broke the program. Unfortunately just adding 'volatile' in front of run, gotoloc and num did not fix it. It might be gcc is not built for optimizing this kind of code.

Defining volatile int num outside of main should do it. With static, gcc thinks it knows who can mess with it.

unfortunately I can't create gotoloc outside the main, or I could, but I would have to set it to zero outside and then only reset in in the beginning of main if it's zero. And the appeal stats to fade. So I think it's best to say that I'm using C a bad way, gcc rightfully doesn't optimize it correctly so don't try.

Perl
I'm not very good at bowling, but I suspect this may interest the OP. This is a Sieve of Eratosthenes using a variable goto. Were this to be 'refactored', I doubt any of it would be reusable, other than perhaps the first few lines. When the sieve ends, all remaining 1s in the @primes array correspond to prime values.
For added fun, no ands, ors, ternaries, conditionals or comparison operators of any kind are used.
@primes[2..1e4]=(1)x9999;
$a=2;
Y:
  $b=$a*~-$a;
X:
  $primes[$b+=$a+=$c=$a/100%2+$b/1e4%2]=0;
  goto"$c"^h;
Z:

In case there's any confusion as to why I'm posting this here, in a separate question (now deleted), the OP stated that, "this was the question he actually wanted to ask", but wasn't sure if it was possible.

In case there's any confusion as to what question I posted, it was a question about building code using only GOTO's, rather than just one.

@JoeZeng I originally had three, but I reduced it to one so that it would be a valid solution to this problem as well.

C
My usage of macros perhaps doesn't make it "one GOTO".
And it's quite short, so "completely restructured" isn't much.
But here's my attempt anyway.
Reads a number from standard input, prints it modulu 3.
int main() {
    char s[100], *p, r=0;
    void *pl[] = { &&a, &&b, &&c, &&d, &&e, &&f, &&g, &&h, &&i, &&j, &&a, &&b, &&x, &&y, &&z }, *p1;
    p = gets(s);
    #define N(n) (pl+n)[!*p*60+*p-48];p++;goto *p1
    a: p1=N(0);
    b: p1=N(1);
    c: p1=N(2);
    d: p1=N(0);
    e: p1=N(1);
    f: p1=N(2);
    g: p1=N(0);
    h: p1=N(1);
    i: p1=N(2);
    j: p1=N(0);
    z: r++;
    y: r++;
    x: printf("%d\n", r);

    return 0;
}

Yeah, using macros like that isn't "one GOTO". But even then, you'd need to provide the restructuring of the program without using a GOTO. Removing statements doesn't add to your score.

Printing a number modulo 3 would be easy by just using a printf and scanf. Your solution's score would most likely be about 2 or 3.

You can easily write another program that prints n%3. But it won't use this program's logic, so I don't think it would be a restructuring of this program.

Fair point. I can't think of why anybody would ever want to program something that prints n%3 in that way, though. It should be a program that becomes convoluted when the GOTO is removed, not when it is introduced.

"Why?" is irrelevant for this site - it's full of stupid ways to do stupid things. If you remove goto, the program won't work. But what did you expect - that the program would become convoluted by the removal alone?

By the removal and subsequent restructuring, yes. A simple example might be the use of goto to break out of multiple nested loops.


text:
Solve Rubik's cube
Write the shortest program that solves Rubik's cube (3*3*3) within a reasonable amount of time and moves (say, max. 5 seconds on your machine and less than 1000 moves).
The input is in the format:
UF UR UB UL DF DR DB DL FR FL BR BL UFR URB UBL ULF DRF DFL DLB DBR

(this particular input represents the solved cube).
First 12 2-character strings are the edges in the UF, UR, ... BL positions (U=up, F=front, R=right, B=back, L=left, D=down), then the next 8 3-character strings are the corners in the UFR, URB, ... DBR positions.
The output should give a sequence of moves in this format:
D+ L2 U+ F+ D+ L+ D+ F+ U- F+

Where D1 or D+ represents turning the D (down) face clockwise 90 degrees, L2 is turning the L face 180 degrees, U3 or U- represents turning the U face counterclockwise 90 degrees.
Letters are case-insensitive and spaces are optional.
For example, the output above is correct for the following input:
RU LF UB DR DL BL UL FU BD RF BR FD LDF LBD FUL RFD UFR RDB UBL RBU

For more details, please refer to Tomas Rokicki's cube contest, except scoring will be done directly by file size like a normal code golfing problem. An online tester is included too.
For reference, the shortest solution already written is the last entry in the list of cube contest winners

For those struggling to visualise the layout format:
0-1 2-3 4-5 6-7 8-9 10-11 12-13 14-15 16-17 18-19 20-21 22-23 24-25-26 27-28-29 30-31-32 33-34-35 36-37-38 39-40-41 42-43-44 45-46-47
UF  UR  UB  UL  DF   DR    DB   DL    FR    FL     BR    BL     UFR      URB      UBL      ULF      DRF      DFL      DLB      DBR

Front:

                 +-------+-------+-------+
                /       /       /       /|
               /  30   /   4   /  27   / |
              +-------+-------+-------+  |
             /       /       /       /|28+
            /   6   /       /   2   / | /|
           +-------+-------+-------+  |/ |
          /       /       /       /|3 +  |
         /  33   /   0   /  24   / | /|21+
        +-------+-------+-------+  |/ | /|
        |       |       |       |26+  |/ |
        |  35   |   1   |   25  | /|  +  |
        |       |       |       |/ | /|47+
        +-------+-------+-------+  |/ | /
        |       |       |       |17+  |/
        |  18   |       |  16   | /|11+
        |       |       |       |/ | /
        +-------+-------+-------+  |/
        |       |       |       |37+
        |  40   |   9   |  38   | /
        |       |       |       |/
        +-------+-------+-------+

Hidden faces:

                 +-------+-------+-------+
                /|       |       |       |
               / |  31   |   5   |  29   |
              +  |       |       |       |
             /|32+-------+-------+-------+
            / | /|       |       |       |
           +  |/ |  22   |       |  20   |
          /|7 +  |       |       |       |
         / | /|23+-------+-------+-------+
        +  |/ | /|       |       |       |
        |34+  |/ |  44   |  13   |  46   |
        | /|  +  |       |       |       |
        |/ | /|43+-------+-------+-------+
        +  |/ | /       /       /       /
        |19+  |/  42   /  12   /  45   /
        | /|15+-------+-------+-------+
        |/ | /       /       /       /
        +  |/  14   /       /  10   /
        |41+-------+-------+-------+
        | /       /       /       /
        |/  39   /   8   /   36  /
        +-------+-------+-------+

Are languages other than C/C++/Java/Perl/Python accepted?

@EgorSkriptunoff In here yes, use whatever you like, just no cube-solving libraries.

And what about scoring?  Usual code-golf scoring (bytes in program) or complex scoring like in 2004 contest?

@EgorSkriptunoff I already addressed that: "scoring will be done directly by file size like a normal code golfing problem"

@primo thanks for your interest in this :)

Sorry, I'm a bit inattentive on Tuesdays.  :-)  Does this code-golf expected to be more interesting than simple "implement Thistlethwaite's algorithm" exercise?

@EgorSkriptunoff the shortest solution I've seen doesn't use Thistlethwaite's

oooo I wanna try this.

I'm having a really difficult time understanding the input formatting. I just can't visualize it at all. :\ I understand that there are only 20 ACTUAL cube pieces, but... maybe I just need a diagram or something. (NOTE: I am severely dyslexic {and I have mild ADD}, so this may be part of my problem.)

Could someone assist me by labeling this diagram I made? :P

@jdstankosky, I've added a diagram.

I actually tried to do that, but I cannot find a way to solve the rubiks cube in less than 100 moves, so how come? Here is the method I learn (I think its the basic one): http://www.rubiksplace.com There are any tips in the algorithms to shorten moves I have to do as a human?

Every cube can be solved within 20 moves (it has been proven), but it's very hard to achieve that. However, it's easy even for humans to get under 100 moves. Check out Fridrich, Petrus and Thistlethwaite's algorithms for example.

Besides, this question sets the limit to 1000 moves, not 100.

Are we allowed to pull off the stickers and move them around?

Wouldn't it be more interesting to make the code that can solve it in as few moves as possible?

C++ - 1123
Since nobody posted any answer so far, I decided to simplify and golf my 2004 solution. It's still far behind the shortest one I mentioned in the question.
#include<iostream>
#include<vector>
#define G(i,x,y)for(int i=x;i^y;i++)
#define h(x)s[a[x]/q*q+(a[x]+j)%q-42]
#define B(x)D=x;E=O.substr(j*3,3);G(i,0,3)E+=F[5-F.find(E[2-i])];G(i,0,D.length())D[i]=E[F.find(D[i++])];m.push_back(D);
#define P(a,b)G(i,0,6)G(k,49,52){e[0]=F[i];e[1]=k;m.push_back(e);}G(j,0,24){B(a)B(b)}
#define T C();z=m.size();for(b=c;b;){d=s;G(i,o=w=1,4){w*=z;if(o)G(j,0,w)if(o){s=d;u=j;G(k,0,i){f=m[u%z];G(x,0,f.length()){a=M[F.find(f[x++])];G(i,0,f[x]-48)G(l,0,2){q=3-l;p=4*l;G(j,0,q){t=h(p+3);G(k,-3,0)h(p-k)=h(p-1-k);h(p)=t;}}}u/=z;}C();if(c<b){u=j;G(k,0,i){std::cout<<m[u%z];u/=z;}b=c;o=0;}}}}
std::string s,a,D,E,d,f,e="  ",S="UFURUBULDFDRDBDLFRFLBRBLUFRURBUBLULFDRFDFLDLBDBR",F="ULFBRD",M[]={"KHEB*0.,","KRTI0<8@","KDNS*;2=","IVXG/@7>","BGWP,>4:","QNWT2468"},O=S.substr(24)+"FDRFRUFULFLDRDBRBURUFRFDBDLBLUBURBRDLDFLFULUBLBD";std::vector<std::string>m;int
w,X=8,Y=16,o,c,u,b,z,p,q,t;void C(){c=0;G(i,X,Y)c+=s[i]!=S[i];}main(int
g,char**v){G(i,1,g)s+=v[i];P("U2F1R1L3U2L1R3F1U2","L3R1F3L1R3D2L3R1F3L1R3");T;Y=24;T;X=0;T;m.clear();P("R3D3R1D3R3D2R1L1D1L3D1L1D2L3","R1F3L3F1R3F3L1F1");G(I,5,9){Y=I*6;T}}

It's not random, but it also doesn't proceed straightforwardly. It solves the edges first, then the corners. At each step, it tries various combinations of up to 4 algorithms and simple face turns (sequentially, not randomly), till it finds an improvement in the number of solved pieces, then repeats until solved. It uses 2 algorithms for edges and 2 for corners, translated to all cube positions.
Example output for RU LF UB DR DL BL UL FU BD RF BR FD LDF LBD FUL RFD UFR RDB UBL RBU:
L2F3B2F3B1U3F1B3R2F3B1U3F1B3D2F2L3D2L1U2B1L1R3U2R1L3B1U2R1U2L1F1B3U2B1F3L1U2L3R1D3L1R3B2L3R1D3L1R3L3R1D3L1R3B2L3R1D3L1R3B3F1D3B1F3R2B3F1D3B1F3U2F3L3R1B3L1R3U2L3R1B3L1R3F1D2F1L1R3D2R1L3F1D2F3L2U1B1F3L2F1B3U1L2R3L1F3R1L3U2R3L1F3R1L3U1F2U1L1R3F2R1L3U1F2U3L3U3L1U3L3U2L1R1U1R3U1R1U2R3F3U3F1U3F3U2F1B1U1B3U1B1U2B3L1B3R3B1L3B3R1B1B3D3B1D3B3D2B1F1D1F3D1F1D2F3R1F3L3F1R3F3L1F1R3B3R1B3R3B2R1L1B1L3B1L1B2L3R1D3L3D1R3D3L1D1B3D3B1D3B3D2B1F1D1F3D1F1D2F3U3R3U1R3U3R2U1D1R1D3R1D1R2D3
(234 moves, 0.3 sec here)

What do you know... another answer was posted within seconds :)

Although this is longer than the Ruby solution, I feel that it better fits the problem criteria "within a reasonable amount of time and moves." I'd still like to see a solution which averages under ~50 moves, though.

@primo Thanks :) My original code averaged over 50 moves, for under 50 I think you either need more (cube) algorithms or a different approach such as Thistlethwaite's method. However, efficiency (in no. of moves) is not very compatible with golfing. Anyway, for alternative solutions check out the winners of Tomas Rokicki's contest.

Python 1166 bytes
A considerable amount of whitespace has been left for the sake of readability. Size is measured after removing this whitespace, and changing various indentation levels to Tab, Tab Space, Tab Tab, etc. I've also avoided any golfing which affected the performance too drastically.
T=[]
S=[0]*20,'QTRXadbhEIFJUVZYeijf',0
I='FBRLUD'

G=[(~i%8,i/8-4)for i in map(ord,'ouf|/[bPcU`Dkqbx-Y:(+=P4cyrh=I;-(:R6')]
R=range

def M(o,s,p):
 z=~p/2%-3;k=1
 for i,j in G[p::6]:i*=k;j*=k;o[i],o[j]=o[j]-z,o[i]+z;s[i],s[j]=s[j],s[i];k=-k

N=lambda p:sum([i<<i for i in R(4)for j in R(i)if p[j]<p[i]])

def H(i,t,s,n=0,d=()):
 if i>4:n=N(s[2-i::2]+s[7+i::2])*84+N(s[i&1::2])*6+divmod(N(s[8:]),24)[i&1]
 elif i>3:
  for j in s:l='UZifVYje'.find(j);t[l]=i;d+=(l-4,)[l<4:];n-=~i<<i;i+=l<4
  n+=N([t[j]^t[d[3]]for j in d])
 elif i>1:
  for j in s:n+=n+[j<'K',j in'QRab'][i&1]
 for j in t[13*i:][:11]:n+=j%(2+i)-n*~i
 return n

def P(i,m,t,s,l=''):
 for j in~-i,i:
  if T[j][H(j,t,s)]<m:return
 if~m<0:print l;return t,s
 for p in R(6):
  u=t[:];v=s[:]
  for n in 1,2,3:
   M(u,v,p);r=p<n%2*i or P(i,m+1,u,v,l+I[p]+`n`)
   if r>1:return r

s=raw_input().split()
o=[-(p[-1]in'UD')or p[0]in'RL'or p[1]in'UD'for p in s]
s=[chr(64+sum(1<<I.find(a)for a in x))for x in s]

for i in R(7):
 m=0;C={};T+=C,;x=[S]
 for j,k,d in x:
  h=H(i,j,k)
  for p in R(C.get(h,6)):
   C[h]=d;u=j[:];v=list(k)
   for n in i,0,i:M(u,v,p);x+=[(u[:],v[:],d-1)]*(p|1>n)
 if~i&1:
  while[]>d:d=P(i,m,o,s);m-=1
  o,s=d

Sample usage:
$ more in.dat
RU LF UB DR DL BL UL FU BD RF BR FD LDF LBD FUL RFD UFR RDB UBL RBU

$ pypy rubiks.py < in.dat
F3R1U3D3B1
F2R1F2R3F2U1R1L1
R2U3F2U3F2U1R2U3R2U1
F2L2B2R2U2L2D2L2F2

This is an implementation of Thistlethwaite's Algorithm, using an IDA* search to solve for each step. Because all of the heuristic tables need to be calculated on the fly, several compromises have been made, usually breaking a heuristic into two or more fairly equal size parts. This makes the computation of the heuristic tables many hundreds of times faster, while slowing down the search phase, usually only slightly, but it can be significant depending on the initial cube state.
Variable Index

T - the main heuristic table.
S - a solved cube state. Each individual piece is stored as a bit mask, represented as a character. A solved orientation vector is defined as the zero vector.
I - the various twists, in the order that they are eliminated from the search space.
G - the groups for twist permutations, stored as pairs to be swapped. Each byte in the compressed string encodes for one pair. Each twist needs six swaps: three for the edge cycle, and three for the corner cycle. The compressed string contains only printable ascii (char 32 to 126).
M - a function that performs a move, given by G.
N - converts a permutation of four objects to a number, for encoding purposes.
H - calculates the heuristic value for the given cube state, used to lookup move depth from T.
P - perform a search at a single depth of a single phase of the algorithm.
s - the input cube's permutation state.
o - the input cube's orientation vector.

Performance
Using Tomas Rokicki's data set, this script averaged 16.02 twists per solve (maximum 35), with an average time of 472ms (i5-3330 CPU @ 3.0 Ghz, PyPy 1.9.0). Minimum solve time was 233ms with a maximum of 2.97s, standard deviation 0.488.  Using the scoring guidelines from the contest (white space is not counted, keywords and identifiers count as one byte for a length of 870), the overall score would have been 13,549.
For the last 46 cases (the random states), it averaged 30.83 twists per solve, with an average time of 721ms.

Notes on Thistlethwaite's Algorithm
For the benefit of anyone who might want to attempt an implementation of Thistlethwaite's Algorithm, here is a brief explanation.
The algorithm works on a very simple solution space reduction principle. That is, reduce the cube to a state in which a subset of twists are not necessary to solve it, reduce it to a smaller solution space, and then solve the remainder using only the few twists remaining.
Thistlethwaite originally suggested <L,R,F,B,U,D> → <L,R,F,B,U2,D2> → <L,R,F2,B2,U2,D2> → <L2,R2,F2,B2,U2,D2>. However, given the input format, I think it is easier to first reduce to <L,R,F2,B2,U,D> (no quarter turn F or B), and then <L2,R2,F2,B2,U,D> before finally reaching the half turn state. Instead of explaining exactly why this is, I think it will be evident after defining the criteria for each state.
<L,R,F,B,U,D> ⇒ <L,R,F2,B2,U,D>
In order to eliminate F and B quarter turns, only the edges must be oriented correctly. Gilles Roux has a very good explanation on his site of what 'correct' and 'incorrect' orientation is, so I'll leave the explaining to him. But basically, (and this is why this input format is so condusive to F and B elimination), an edge cubie is correctly oriented if it matches the following regex: [^RL][^UD]. A correct orientation is typically signified with a 0 and incorrect with 1. Basically U and D stickers may not appear on the R or L faces, or on the edges of the any U or D edge cubies, or they cannot be moved into place without requiring an F or B quarter twist.
<L,R,F2,B2,U,D> ⇒ <L2,R2,F2,B2,U,D>
Two criteria here. First, all corners must be oriented correctly, and second, each of the for middle layer cubies (FR, FL, BR, BL) must be somewhere in the middle layer. A corner orientation is very simply defined given the input format: the position of the first U or D. For example, URB has orientation 0 (correctly oriented), LDF has orientation 1, and LFU has orientation 2.
<L2,R2,F2,B2,U,D> ⇒ <L2,R2,F2,B2,U2,D2>
The criteria here is as follows: each face may only contain stickers from its face, or from the face directly opposite it. For example, on the U face there may only be U and D stickers, on the R face there may only be R and L stickers, on the F face there may only be F and B stickers, etc. The easiest way to ensure this is to check if each edge piece is in its 'slice', and each corner piece in its 'orbit'. Additionally, one needs to pay attention to edge-corner parity. Although, if you check only for corner parity, edge parity is also guaranteed, and vice versa.
How twists affect orientation
U and D twists affect neither the edge orientation, nor the corner orientation. The pieces may be swapped directly without updating the orientation vector.
R and L twists do not affect the edge orientation, but they do affect the corner orientation. Depending on how you define your cycle, the change in corner orientation will either be +1, +2, +1, +2 or +2, +1, +2, +1, all modulo 3. Note that R2 and L2 twists do not affect the corner orientation, as +1+2 is zero modulo 3, as is +2+1.
F and B affect both the edge orientations and corner orientations. Edge orientations become +1, +1, +1, +1 (mod 2), and corner orientations are the same as for R and L. Note that F2 and B2 affect neither the edge orientations, nor corner orientations.

Great writeup. Have you heard of Kociemba's algorithm?

I have. In principle, it's the same algorithm, except instead of four phases, it has only two: <L,R,F,B,U,D> -> <L2,R2,F2,B2,U,D> -> <I>. It requires a maximum of 29 twists to solve a cube (instead of 52 for Thistlethwaite's), but it also requires very large lookup tables, which would be impractical to generate 'on the fly'.

@P0W the input format is a bit confusing, I suspect you may have an error there. Every case I've verified results in a solution.

@primo Would you mind publishing a link to the non-golfed code if you have it?

Ruby, 742 characters
r=->y{y.split.map{|x|[*x.chars]}}
G=r['UF UR UB UL DF DR DB DL FR FL BR BL UFR URB UBL ULF DRF DFL DLB DBR']
o=r[gets]
x=[];[[%w{U UU UUU L LL LLL}+D=%w{D DD DDD},0],[%w{FDFFF RFDFFFRRR}+D,12],[%w{DDDRRRDRDFDDDFFF DLDDDLLLDDDFFFDF}+D,8],[%w{DFLDLLLDDDFFF RDUUUFDUUULDUUUBDUUU}+D,4],[%w{LDDDRRRDLLLDDDRD RRRDLDDDRDLLLDDD LFFFLLLFLFFFLLLF},16]].map{|q,y|x+=[*y..y+3]
3.times{q.map{|e|q|=[e.tr('LFRB','FRBL')]}}
w=->u{x.count{|t|u[t]!=G[t]}}
s=w[o]
(c=(0..rand(12)).map{q.sample}*''
z=o
c.chars{|m|z="=$'*:036\".?BOHKVGRWZ!$@*-0C69<4(E\\INQTMX!$'B-03<9*?6EHYLQPUZ!9'*-?360<$BSFKN[TWJ$'*!-0369<?BHKNEQTWZ!$'*6-039<?BEHKNTWZQ"[20*('FBLRUD'=~/#{m}/),20].bytes.map{|e|z[e/3-11].rotate e%3}}
t=w[z]
(c.chars{|e|$><<e<<'1 '};o=z;s=t)if s>t
)until s<1}

The above ruby code is not yet golfed fully. There are still possibilities to improve the code further (but its already enough as a starter).
It solves the cube layer by layer but uses no specific algorithm but instead performs random sequences of moves until the cube is solved.
Due to the probabilistic nature it may sometimes take longer than 5 seconds to solve the cube and in rare cases take more than 1000 moves.
Example output (for input 'RU LF UB DR DL BL UL FU BD RF BR FD LDF LBD FUL RFD UFR RDB UBL RBU') is 757 moves:
F1 R1 R1 F1 F1 F1 R1 R1 R1 L1 L1 L1 F1 D1 L1 L1 D1 D1 D1 D1 L1 B1 D1
B1 B1 B1 L1 L1 L1 F1 D1 F1 F1 F1 L1 D1 L1 L1 L1 B1 D1 B1 B1 B1 R1 D1
R1 R1 R1 L1 B1 D1 B1 B1 B1 L1 L1 L1 D1 D1 B1 D1 B1 B1 B1 B1 D1 B1 B1
B1 L1 D1 L1 L1 L1 D1 D1 D1 D1 D1 R1 D1 R1 R1 R1 R1 F1 D1 F1 F1 F1 R1
R1 R1 R1 D1 R1 R1 R1 F1 L1 D1 L1 L1 L1 F1 F1 F1 D1 D1 D1 D1 L1 D1 L1
L1 L1 F1 L1 D1 L1 L1 L1 F1 F1 F1 D1 D1 L1 D1 L1 L1 L1 D1 L1 D1 L1 L1
L1 L1 D1 L1 L1 L1 D1 R1 D1 D1 D1 R1 R1 R1 D1 D1 D1 B1 B1 B1 D1 B1 D1
L1 D1 D1 D1 L1 L1 L1 D1 D1 D1 F1 F1 F1 D1 F1 D1 D1 D1 B1 B1 B1 D1 B1
D1 R1 D1 D1 D1 R1 R1 R1 D1 D1 D1 B1 B1 B1 D1 B1 D1 R1 D1 D1 D1 R1 R1
R1 D1 B1 D1 D1 D1 B1 B1 B1 D1 D1 D1 L1 L1 L1 D1 L1 D1 B1 D1 D1 D1 B1
B1 B1 D1 D1 D1 L1 L1 L1 D1 L1 D1 D1 F1 D1 D1 D1 F1 F1 F1 D1 D1 D1 R1
R1 R1 D1 R1 D1 D1 D1 R1 R1 R1 D1 R1 D1 F1 D1 D1 D1 F1 F1 F1 D1 B1 D1
D1 D1 B1 B1 B1 D1 D1 D1 L1 L1 L1 D1 L1 D1 D1 D1 F1 F1 F1 D1 F1 D1 L1
D1 D1 D1 L1 L1 L1 D1 D1 D1 D1 D1 D1 F1 F1 F1 D1 F1 D1 L1 D1 D1 D1 L1
L1 L1 D1 D1 D1 F1 F1 F1 D1 F1 D1 L1 D1 D1 D1 L1 L1 L1 D1 F1 D1 D1 D1
F1 F1 F1 D1 D1 D1 R1 R1 R1 D1 R1 D1 D1 D1 F1 F1 F1 D1 F1 D1 L1 D1 D1
D1 L1 L1 L1 D1 D1 D1 F1 F1 F1 D1 F1 D1 L1 D1 D1 D1 L1 L1 L1 D1 D1 D1
D1 D1 F1 F1 F1 D1 F1 D1 L1 D1 D1 D1 L1 L1 L1 D1 D1 D1 D1 D1 D1 R1 F1
D1 F1 F1 F1 D1 D1 D1 R1 R1 R1 D1 F1 L1 D1 L1 L1 L1 D1 D1 D1 F1 F1 F1
D1 B1 R1 D1 R1 R1 R1 D1 D1 D1 B1 B1 B1 D1 B1 R1 D1 R1 R1 R1 D1 D1 D1
B1 B1 B1 D1 D1 D1 D1 B1 R1 D1 R1 R1 R1 D1 D1 D1 B1 B1 B1 D1 D1 D1 D1
D1 D1 B1 B1 B1 D1 F1 D1 D1 D1 B1 D1 F1 F1 F1 D1 D1 D1 R1 R1 R1 D1 L1
D1 D1 D1 R1 D1 L1 L1 L1 D1 D1 D1 B1 D1 D1 D1 F1 F1 F1 D1 B1 B1 B1 D1
D1 D1 F1 D1 B1 B1 B1 D1 F1 D1 D1 D1 B1 D1 F1 F1 F1 D1 D1 D1 L1 D1 D1
D1 R1 R1 R1 D1 L1 L1 L1 D1 D1 D1 R1 D1 F1 R1 R1 R1 F1 F1 F1 R1 F1 R1
R1 R1 F1 F1 F1 R1 R1 R1 R1 D1 L1 D1 D1 D1 R1 D1 L1 L1 L1 D1 D1 D1 B1
B1 B1 D1 F1 D1 D1 D1 B1 D1 F1 F1 F1 D1 D1 D1 F1 R1 R1 R1 F1 F1 F1 R1
F1 R1 R1 R1 F1 F1 F1 R1 F1 D1 D1 D1 B1 B1 B1 D1 F1 F1 F1 D1 D1 D1 B1
D1 F1 R1 R1 R1 F1 F1 F1 R1 F1 R1 R1 R1 F1 F1 F1 R1 F1 F1 F1 D1 B1 D1
D1 D1 F1 D1 B1 B1 B1 D1 D1 D1 R1 D1 D1 D1 L1 L1 L1 D1 R1 R1 R1 D1 D1
D1 L1 D1 R1 R1 R1 D1 L1 D1 D1 D1 R1 D1 L1 L1 L1 D1 D1 D1 R1 D1 D1 D1
L1 L1 L1 D1 R1 R1 R1 D1 D1 D1 L1 D1 F1 F1 F1 D1 B1 D1 D1 D1 F1 D1 B1
B1 B1 D1 D1 D1 L1 L1 L1 D1 R1 D1 D1 D1 L1 D1 R1 R1 R1 D1 D1 D1

It is possible to reduce the move-count considerably if same moves are grouped together. Therefore, one can replace the output like
(c.gsub(/(.)\1*/){j=$&.size%4;$><<$1<<j<<' 'if j>0};o=z;s=t)if s>t

Nice, but sometimes it takes more than 20 sec on my computer, in one case it finished in 48.7 sec

@aditsu Yes. But it also strongly depends on which ruby interpreter you use. On my machine it usually takes less than 5 seconds.

I'm currently using ruby 1.9.3_p392, it often takes less than 5 seconds but I can't say "usually"

Try this input: FU FR RU BR DB LD LU LB LF RD DF BU FRU BUR FDR DLB DFL LUB FUL DBR

One request: could you consolidate sequences like U1 U1 U1 into a single U3?

@primo Of course it is possible - see my edit. Will cost you 27 characters if you introduce it.