text:
The Government has a Limited Supply of Walls
Introduction
Knowledgeable code golfers prepared us for the doomsday flood. Areas at risk were evacuated, and the population moved to high ground.
We underestimated the flood (or perhaps there was a bug in @user12345's code). Some high-ground areas are rapidly approaching sea level. Walls must be erected in order to ensure the survival of the now densely populated encampments. Sadly, the government has a limited supply of walls.
Problem
Our doomsday scenario is described by two numbers on a single line, n and m. Following that line are n lines with m values per line, separated only by a single space. Each value will be one of four characters.

x Impassable. Water cannot flow here. Walls cannot be erected here.
- Unstable. Water can flow through this here. Walls cannot be erected here.
. Stable. Water can flow through here. Walls can be erected here.
o Encampment. Water can flow through here. If it does, everyone dies. Walls cannot be built here.

Water will flow from all edges of the map, unless the edge is impassable or a wall is constructed on the tile. Write a program that can output the minimum number of walls required to protect an encampment.
Example Input
 6 7
 x . . x x x x
 x . . x - - x
 x . x x - - x
 x . o o o - .
 x . o o o - .
 x x x x x x x

Example Output
3

Assumptions

Water only flows orthogonally
Encampments only exist as one orthonagonally contiguous block per scenario
A solution will always exist (although it may require copious amounts of walls)
Encampments cannot be located on an edge, as the scenario would then have no solution
2 < n < 16
2 < m < 16
Input may be provided from stdin, read from "city.txt", or accepted as a single argument

Shortest code wins!

Would it be acceptable for the program to be correct, yet take longer than the known universe has existed to provide a solution for certain instances of the problem?

@Claudiu I am somewhat new to Code Golf. My requirement failed to specify a time limit, so one does not exist. The burden falls to the answer to prove that a solution is correct for all instances of the problem. If you have a solution that solves some (but not all) instances in a clever/cool way, I still encourage you to post it just for fun.

Code golf typically does not require time restrictions.

Cool! Another Q: is input required to be as you specified or can we put it in another form?

@Claudiu I can't accept anything outside of the requirements. You can, however, suggest an edit to the requirements using the edit button. Seeing as there are no answers yet, I'll probably accept the edit right away.

@Rusher: Ok I suggested the edit. What it will serve to do is remove the parsing-the-input part from the problem. So python could slurp all that with input() instead of having to parse it. up to you if you like the idea!

@Claudiu The edit "allow for other forms of input" wasn't nearly specific enough. I think the current allowance is fair, so let's keep it that way.

+1, interesting challenge. The requirement that input filename have length 8 seems rather arbitrary to me though.

I wonder if brute force will always be shorter, or if doing a proper algorithm (I think it's a max-flow/min-cut problem?) could be shorter..

@kaya Sorry, this is my second question here. I couldn't imagine all the crazy places people would pull their inputs from if I didn't specify, but I'll leave the file name open next time. Do you think the spec would look good then? (Sorry.. I know this is kind of chatty!)

Mathematica, 257 253 chars
d="city.txt"~Import~"Table";g=EdgeAdd[#,∞<->Tr@#&/@Position[VertexDegree@#,2|3]]&@GridGraph@d[[1,{2,1}]];{o,x,s}=Tr/@Position[Join@@d[[2;;]],#]&/@{"o","x","."};Catch@Do[If[Min[GraphDistance[VertexDelete[g,x⋃w],∞,#]&/@o]==∞,Throw@Length@w],{w,Subsets@s}]

Input is read from "city.txt".
Explanation:
Mathematica has many functions to deal with graphs.
First, I read the data from "city.txt".
d="city.txt"~Import~"Table";

Then I construct a grid graph with 'm'*'n' vertices (GridGraph@d[[1,{2,1}]]), and add to it a "vertex at infinity" which is connected to every vertex on the "edges" of the graph. This vertex is where the water flow from.
g=EdgeAdd[#,∞<->Tr@#&/@Position[VertexDegree@#,2|3]]&@GridGraph@d[[1,{2,1}]];

And o, x and s denote the positions of "o", "x" and "." respectively.
{o,x,s}=Tr/@Position[Join@@d[[2;;]],#]&/@{"o","x","."};

Then for any subset w of s (the subsets are sorted by length), I delete the vertices in x and w from g (VertexDelete[g,x⋃w]), and find the length of the shortest path from the "vertex at infinity" to the encampment o. If the length is infinity, then the encampment will be safe. So the length of the first such w is the minimum number of walls required to protect an encampment.
Catch@Do[If[Min[GraphDistance[VertexDelete[g,x⋃w],∞,#]&/@o]==∞,Throw@Length@w],{w,Subsets@s}]

Nice! I figured i'd get scooped by a different approach in a different language.

Upvoting but I would do so more proudly if you would explain your code for the rest of us.

Can someone vouch that this answer is correct or provide an online intepreter for "Mathematica"? Having trouble finding one.

@Rusher I've verified it, and it's solid. There's no online interpreter for MM, but there is a downloadable CDF document format which I and a couple others have started experimenting with to share solutions. You can also get Mathematica for free with the Raspberry Pi ARM computer, with the caveat that you're limited by the box's computing power. FWIW, we MM users do our best to keep each other honest and we're working on making our submissions more accessible (a problem also faced by Matlab, Maple, MS languages that don't work on Mono, etc.)

Python, 553 525 512 449 414 404 387 368 characters (+4? for invocation)
I had way too much fun golfing this. It's 82 bytes bigger if you try to compress it! Now that's a measure of compactness and lack of repetition.
R=range;import itertools as I
f=map(str.split,open('city.txt'))[1:]
S=[]
def D(q):
 q=set(q)
 def C(*a):
    r,c=a
    try:p=(f[r][c],'x')[a in q]
    except:p='x'
    q.add(a)
    if'.'==p:S[:0]=[a]
    return p<'/'and C(r+1,c)|C(r-1,c)|C(r,c+1)|C(r,c-1)or'o'==p
 if sum(C(j,0)|C(j,-1)|C(0,j)|C(-1,j)for j in R(16))<1:print n;B
D(S);Z=S[:]
for n in R(len(Z)):map(D,I.combinations(Z,n))

Indentation levels are space, tab.
Usage:
Reads from city.txt:
6 7
x . . x x x x
x . . x - - x
x . x x - - x
x . o o o - .
x . o o o - .
x x x x x x x

Invoke as follows:
$ python floodfill_golf.py 2>X
3

The 2>X is to hide stderr since program exits by raising an exception. If this is considered unfair feel free to add 4 characters for the invocation.
Explanation:
Simple brute force. C does a flood-fill and returns true if it hit an encampment. No extra padding since it took too much space to set the padding up properly. D, given a set of walls to fill in, calls C from every point on the edge such that C accounts for those walls, and prints length and exits if none of them reached the encampment. The list of walls is also used to keep track of the flood-fill, so no copying of the board is required! Trickily, C also appends any empty spots it finds to a list, S, so the function D is also used to first construct the list of empty spots. For this reason, I use sum instead of any, to ensure all the .s are collected on the first run-through.
I invoke D once, then copy the list of empty spots into Z since S will keep being appended to (inefficient, but cheaper on character count). Then I use itertools.combinations to select each combo of empty spots, from 0 spots up. I run each combo through D and it prints the length of the first one that works, raising an exception to exit the program. If no answer is found then nothing is printed.
Note that currently, the program doesn't work if no walls are needed. It'd be +3 characters to take care of this case; not sure if it's necessary.
Also note that this is an O(2^n) algorithm, where n is the number of empty spots. So, for a 15x15 completely empty board with one encampment in the middle, this will take 2^(15*15-1) = 2.6959947e+67 iterations to complete, which is going to be a very long time indeed!

C, 827 799 522
Golfed:
#define N for(
#define F(W,X,Y,Z) N i= W;i X Y;i Z)
#define C(A,B,C) if(c[A][B]==C)
#define S(W,X,Y,Z,A,B) p=1;F(W,X,Y,Z)C(A,B,120)p=0;if(p){F(W,X,Y,Z){C(A,B,46){c[A][B]='x';z++;Q();break;}}}else{F(W,X,Y,Z){C(A,B,120)break;else c[A][B]='o';}}
p,m,z,w,h,o,i,u,l,x,y;char c[16][16];Q(){N u=0;u<h;u++)N l=0;l<w;l++)if(c[u][l]=='o'){x=u;y=l;S(x,>,m,--,i,y)S(y,>,m,--,x,i)S(y,<,w,++,x,i)S(x,<,h,++,i,y)}}main(int a, char **v){h=atoi(v[1]);w=atoi(v[2]);N m=-1;o<h;o++)N i=0;i<w;i++)scanf("%c",&c[o][i]);Q();printf("%d",z);}

Input is given with the height and with as command line arguments, and then the grid is read as a single string on stdin like so: ./a.out 6 7 < input where input is in this form (left to right, top to bottom):

x..xxxxx..x--xx.xx--xx.ooo-.x.ooo-.xxxxxxx

"Readable":
#define F(W,X,Y,Z) for(i= W;i X Y;i Z)
#define C(A,B,C) if(c[A][B]==C)
#define S(W,X,Y,Z,A,B) p=1;F(W,X,Y,Z)C(A,B,120)p=0;if(p){F(W,X,Y,Z){C(A,B,46){c[A][B]='x';z++;Q();break;}}}else{F(W,X,Y,Z){C(A,B,120)break;else c[A][B]='o';}}

/*Example of an expanded "S" macro:
p=1;
for(i=x;i>m;i--) if(c[i][y]==120) p=0;
if(p)
{
    for(i=x;i>m;i--)
    {
        if(c[i][y]==46)
        {
            c[i][y]='x';
            z++;
            Q();
            break;
        }
    }
}
else
{
    for(i= x;i > m;i --)
    {
        if(c[i][y]==120) break;
        else c[i][y]='o';
    }
}
*/

p,m,z,w,h,o,i,u,l,x,y;
char c[16][16];
Q(){
    for(u=0;u<h;u++)
        for(l=0;l<w;l++)
            if(c[u][l]=='o')
            {
        x=u;y=l;
        S(x,>,m,--,i,y)
        S(y,>,m,--,x,i)
        S(y,<,w,++,x,i)
        S(x,<,h,++,i,y)
            }
}

main(int a, char **v)
{
    h=atoi(v[1]);
    w=atoi(v[2]);
    for(m=-1;o<h;o++)
        for(i=0;i<w;i++)
            scanf("%c",&c[o][i]);
    P();
    Q();
    printf("%d\n",z);
    P();
}

//Omitted in golfed version, prints the map.
P()
{
    for(o=0;o<h;o++)
    {
        for (i=0;i<w;i++) printf("%c",c[o][i]);
        printf("\n");
    }
}

Nowhere near as short as the solution by @Claudiu, but it runs blazingly fast. Instead of flood filling from the edges, it finds the encampment and works outward from the 'o' tokens.

If it encounters any unstable ground next to the encampment, it expands the encampment onto it.
If any encampment on the grid doesn't have at least one wall in each direction, it moves in that direction until it can build a wall.
After each new wall section is placed, it recurses to find the next wall section to place.

Sample wall placements:
x..xxxx                           x..xxxx
x..x--x                           x..xoox
x.xx--x                           x3xxoox
x.ooo-.  <-- results in this -->  xooooo1
x.ooo-.                           xooooo2
xxxxxxx                           xxxxxxx

Oh interesting approach! Does it always give shortest answer? e.g. what answer does it give for this map? It should be 3 (marked where new walls go with @). I tried running your code myself but it didn't seem to work

Oops, seems that golfing and alcohol don't mix very well... I golfed in some undefined behavior.  Should be fixed now along with the 277 unnecessary characters.

@Claudiu - See my comment above, results for the map you posted are at http://pastebin.com/r9fv7tC5. This should always give the shortest answer, but I've only tested it with 10 or 15 maps that I thought might present corner cases. I'd be curious to see if anyone can identify maps that it fails for.

Groovy : 841 805 754
i=new File("city.txt").getText()
x=i[2] as int
y=i[0] as int
m=i[4..i.length()-1].replaceAll('\n','').toList()
print r(m,0)
def r(m,n){if(f(m))return n;c=2e9;g(m).each{p=r(it,n+1);if(p<c)c=p;};return c;}
def f(m){u=[];u.addAll(m);for(i in 0..(x*y)){for(l in 0..m.size()-1){n(l,u);s(l,u);e(l,u);w(l,u);}};m.count('o')==u.count('o')}
def n(i,m){q=i-x;if((((q>=0)&(m[q]=='!'))|(q<0))&m[i]!='x'&m[i]!='W'){m[i]='!'}}
def s(i,m){q=i+x;if((((q>=0)&(m[q]=='!'))|(q<0))&m[i]!='x'&m[i]!='W'){m[i]='!'}}
def e(i,m){q=i+1;if((((q%x!=0)&(m[q]=='!'))|(q%x==0))&m[i]!='x'&m[i]!='W'){m[i]='!'}}
def w(i,m){q=i-1;if((((i%x!=0)&(m[q]=='!'))|(i%x==0))&m[i]!='x'&m[i]!='W'){m[i]='!'}}
def g(m){v=[];m.eachWithIndex{t,i->if(t=='.'){n=[];n.addAll(m);n[i]='W';v<<n}};return v}

Ungolfed:
def i = new File("city.txt").getText()
x=i[2].toInteger()
y=i[0].toInteger()
def m=i[4..i.length()-1].replaceAll('\n','').toList()
println r(m, 0)

def r(m, n){
    if(f(m)) return n
    def c = Integer.MAX_VALUE

    getAllMoves(m).each{ it ->
        def r = r(it, n+1)
        if(r < c) c = r
    }
    return c;
}

def f(m){
    def t = []
    t.addAll(m)
    for(i in 0..(x*y)){
        for(l in 0..m.size()-1){
            n(l,t);s(l,t);e(l,t);w(l,t);
        }
    }
    m.count('o')==t.count('o')
}

def n(i,m){
    def t = i-x;
    if( ( ( (t >= 0) && (m[t]=='!') ) || (t < 0)) && m[i]!='x' && m[i]!='W'){
        m[i]='!'
    }
}

def s(i,m){
    def t = i+x;
    if( ( ( (t >= 0) && (m[t]=='!') ) || (t < 0)) && m[i]!='x' && m[i]!='W'){
        m[i]='!'
    }
}

def e(i,m){
    def t = i+1;
    if( ( ( (t%x!=0) && (m[t]=='!') ) || (t%x==0)) && m[i]!='x' && m[i]!='W'){
        m[i]='!'
    }
}

def w(i,m){
    def t = i-1;
    if( ( ( (i%x!=0) && (m[t]=='!') ) || (i%x==0)) && m[i]!='x' && m[i]!='W'){
        m[i]='!'
    }
}

def getAllMoves(m){
    def moves = []
    m.eachWithIndex { t, i ->
        if(t=='.'){
            def newList = []
            newList.addAll(m)
            newList[i]='W'
            moves << newList
        }
    }
    return moves
}

Much more golfing to come...
Returns 2E9 if no solution.

Dyalog APL, 91 bytes
⊃∊{1∊a[⍸×{(×d)∧s 3∨/3∨⌿⍵}⍣≡4=d←0@⍵⊢a]:⍬⋄≢⍵}¨c[⍋≢¨c←(,⍳2⊣¨b)/¨⊂b←⍸2=a←(s←(4,4,⍨⍉)⍣2)'xo.'⍳⎕]
assumes ⎕IO=0, uses features from v16.0 (@ and ⍸), running time is exponential in the number of .-s
⎕            is evaluated input, must be a matrix of characters
'xo.'⍳       replace x with 0, o with 1, . with 2, and all others with 3
s←(4,4,⍨⍉)⍣2 a function that surrounds a matrix with 4s
a←           assign the numeric matrix surrounded with 4s to a variable a
b←⍸2= b is the list of coord pairs where the 2s (i.e. the .-s) are
(,⍳2⊣¨b)/¨⊂b generate all combinations of elements of b
c[⍋≢¨c←...]  sort them by size
{... :⍬⋄≢⍵}¨ for each combination, check something and return either its length or an empty list
⊃∊           the first non-empty result
d←0@⍵⊢a d is a with some elements replaced with 0
4=           create boolean matrix - where are the 4s? i.e. the border we added
{...}⍣≡      keep on applying the function in {} until the result stabilizes
3∨/3∨⌿⍵    "boolean or" each element with its neighbours
s          the result will be smaller, so let's re-create the border
(×d)∧      apply the non-zero elements of d (the non-walls) as a boolean mask
a[⍸× ...]    what in a corresponds to the 1s in our boolean matrix?
1∊           are there any 1s, i.e. o, encampments?


text:
Turtle Graphics Version 2
Most of you have probably heard of the famous Turtle Graphics program, initially made popular by Logo.  This challenge is to implement a Turtle Graphics program in your language of choice.
Rules:

The floor must be a diagonal with dimensions input by the user through std-in in the form x/y, representing the x and y length, respectively.  x may not be more than 20 and y may not be more than 45,

When the pen is in the down state, it must draw in both the square (the x/y coordinate) the turtle leaves and the square the turtle enters.  This is what would happen in real life, so that is what your program should do.

Initial position and direction of the turtle must be input by the user in the form x,y,d, where x and y are the positions on the x- and y-axis, respectively, and d is the direction, entered as U, D, R, or L (up, down, right, and left, respectively).

You must stop the turtle and display an error message if the turtle hits the wall.  In other words, the turtle cannot walk through the wall.

The turtle must include these commands:

RESET - Resets board to blank - turtle goes back to initial position and direction.
DRAW and ERASE - These commands set the turtle to drawing and erasing, respectively.
UP and DOWN - These two commands set the active tool (pen or eraser) position to up and down, respectively.
DIRECTION x - This command turns the turtle to any direction North, Northeast, East, Southeast, South, Southwest, West, or Northwest, represented as the digits 1-8, with North (up) being 1, Northeast being 2...
FORWARD xx - Advances turtle xx squares; FORWARD 15 advances the turtle 15 squares.  If the turtle is facing N, E, S, of W, it will draw in x squares in that direction only.  If the turtle is facing NE, NW, SE, or SW, it will draw in x squares in both directions; i.e. in FORWARD 1 while facing NE, it will draw this:
 X
X

DISPLAY - Displays board, using X for filled squares (x/y coordinates) and a blank space   for empty squares.
POSITION - Prints turtle's x/y coordinate on the board.
SETPOS x y d - Sets the turtle to the x/y coordinate facing direction d, using the same notation as the DIRECTION command.
STOP - Displays the board, and terminates the program after the user enters the character ~.

Example commands:

DIRECTION 2 FORWARD 1 DIRECTION 4 FORWARD 1:
 X
X X

DIRECTION 2 FORWARD 1 DIRECTION 4 FORWARD 4:
 X
X X
   X
    X

DIRECTION 3 FORWARD 5:
XXXXX

This program will use standard atomic-code-golf scoring rules to try to allow non-esoteric programming languages, such as Java and C++, to compete.
Version 1 is here.  It did not require user input of board size and turtle start point, nor did it require diagonal movements.

Python 3.3 (354?)
I noticed this as an unanswered question and decided to give it a go:
v=input().split('/')+input().split(',')+[input().split(' '),0,1,'X','U','D','L','R']
w,h,x,y,d,c,p,r,m,n,s,l,e=v
w,h,x,y=int(w),int(h),int(x),int(y)
g=[[' 'for x in range(int(h))]for y in range(int(w))]
while p<len(c):
 i=c[p]
 if r:
  g[y][x]=m
 if i=='RESET':
  w,h,x,y,d,c,p,r,m,n,s,l,e=v
 if i=='DRAW':
  m='X'
 if i=='ERASE':
  m=' '
 if i=='UP':
  r=0
 if i=='DOWN':
  r=1
 if i=='DIRECTION':
  p+=1
  i=int(c[p])
  d=''
  if i in[8,1,2]:
   d+=n
  if i in[4,5,6]:
   d+=s
  if i in[6,7,8]:
   d+=l
  if i in[2,3,4]:
   d+=e
 if i=='FORWARD':
  p+=1
  i=int(c[p])
  for _ in range(i):
   if d.find(n)+1:
    y-=1
   if d.find(s)+1:
    y+=1
   if d.find(l)+1:
    x-=1
   if d.find(e)+1:
    x+=1
   if r:
    g[y][x]=m
 if i=='DISPLAY':
  for z in g:
   print(''.join(z))
 if i=='POSITION':
  print(x,y)
 if i=='SETPOS':
  p+=3
  x,y=c[p-2:p]
  d=''
  if i in[8,1,2]:
   d+=n
  if i in[4,5,6]:
   d+=s
  if i in[6,7,8]:
   d+=w
  if i in[2,3,4]:
   d+=e
 if i=='STOP':
  while input()!='~':
   pass
  exit
 if x>w or x<0 or y>h or y<0:
  print('!')
  exit
 p+=1

PS I am unsure about the scoring setup so my score may be incorrect!

Nice.  I guess you win.

source: Stack Exchange

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

sort: votes


text:
Mandelbrot image in every language
I always used a Mandelbrot image as the 'graphical' version of Hello World in any graphical application I got my hands on. Now it's your guys' turn.

Language must be capable of graphical output or drawing charts (saving files disallowed)
Render a square image or graph. The size at least 128 and at most 640 across*
The fractal coordinates range from approximately -2-2i to 2+2i
The pixels outside of the Mandelbrot set should be colored according to the number of iterations before the magnitude exceeds 2 (excluding* black & white)
Each iteration count must have a unique color*, and neighboring colors should preferably be easily distinguishable by the eye
The other pixels (presumably inside the Mandelbrot set) must be colored either black or white
At least 99 iterations
ASCII art not allowed

* unless limited by the platform, e.g. graphical calculator
Allowed:

Disallowed:

(shrunken images)
Winning conditions:
Shortest version (size in bytes) for each language will get a mention in this post, ordered by size.
No answer will ever be 'accepted' with the button.
Leaderboard:

/* Configuration */

var QUESTION_ID = 23423; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 17419; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '
' + c.body.replace(OVERRIDE_REG, '') + '
';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });
    else console.log(body);
  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    lang = jQuery(''+lang+'').text();

    languages[lang] = languages[lang] || {lang: a.language, lang_raw: lang, user: a.user, size: a.size, link: a.link};
  });

  var langs = [];
  for (var lang in languages)
    if (languages.hasOwnProperty(lang))
      langs.push(languages[lang]);

  langs.sort(function (a, b) {
    if (a.lang_raw.toLowerCase() > b.lang_raw.toLowerCase()) return 1;
    if (a.lang_raw.toLowerCase() < b.lang_raw.toLowerCase()) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}
body {
  text-align: left !important;
  display: block !important;
}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}

<link rel="stylesheet" type="text/css" href="https://cdn.sstatic.net/Sites/codegolf/all.css?v=ffb5d0584c5f">

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

"Easily distinguished by the eye" is hard to make objective.  ...Also, apart from your personal association of the two, the Mandelbrot set has nothing to do with Hello World, so it's best to omit that from the title unless you are deliberately trolling the search engines.

I'm just trying to discourage using sequential rgb indices. Thx about the title. I forgot to double-check that after finishing writing.

Related: ASCII Mandelbrot (although some of the answers posted there aren't ASCII and could probably fit better as answers to this question).

Why do you require that neighboring colors be easily distinguishable? Making them vary continuously (but still be distinct) is actually much harder.

I've seen a few people now mentioning that they render the Mandelbrot as a "Hello World". I've done that too, for something like 30 years. The Mandelbrot is the perfect "Hello World" because it shows both that you have pixel access to the display and gives a good feel for compute bound performance on the new platform.

Great idea to ask a question which requires a combination of mathematical and aesthetic sensitivities, then impose all the the design decisions in advance.

Anyone manages to make one in brainfuck WINS, I'd say :D

@Charles Staats: because the brot would become too dark or too plain (see my example). Also noone will try the 'harder' things because they will always increase the code size.

Instead of refusing to "accept" an answer, the way I usually like to run a golfing contest is to accept the shortest answer at the time, and commit to updating the tick should a shorter answer come in later. That way, people actually have a (15 rep) motivation to post the shortest answer.

@CharlesStaats: for me it is harder to make neighboring colors easily distinguishable.

I've noticed a curious pattern. At the 0-indexed iteration 3 the shape invariably seems like a bike saddle.

Not mine and not golfed, but this code is a marvel of obfuscated python producing a mandelbrot fractal

Does my HP42s have enough pixels to do this within the rules?

Read the asterisk

Sharp EL-9300 Graphics Calculator, 296 bytes
This was my secondary school graphing calculator, getting on for 20 years ago!  I remember writing a mandelbrot generator for it way back then.  And sure enough, its still sitting there in the NV memory:
ClrG
DispG
Range -2.35,2.35,.5,-1.55,1.55,0.5
y=-1.55
Label ly
x=-2.35
Label lx
n=1
zx=0
zy=0
Label ln
tzx=zx²-zy²+x
zy=(2*zx*zy)+y
zx=tzx
If zx²+zy²>4Goto esc
n=n+1
If n<20Goto ln
Label esc
If fpart (n/2)=0Goto npl
Plot x,y
Label npl
x=x+.05
If x<=2.35Goto lx
y=y+.05
If y<=1.55Goto ly
Wait

It took about 90 minutes to render.
This is totally ungolfed.  I'm sure I could save a bit of space, but I just wanted to share this historical curiosity!
I love that the only control statements available are gotos.
Here's a photo.  I don't have any other means to get the graphical output out:

Me too, but my NV memory went blank after years of shelf-time.

zx²+zy²>4 couldn't that be Abs(x)>2?

Maybe you should get a new battery...

I had a program just like that on my old TI-95, it took about 2 hours to run. Unfortunately, I no longer have that old calculator...

Interesting.  So you've been a nerd for quite a while.

@devnull Touché!  Guilty as charged.

@NothingsImpossible I'd like to say that this is battery drain due to such a computationally-intensive task.  But really I think its mostly because I put in rechargeable AAAs which have a slightly lower voltage than regular alkaline

Nice "Screenshot"

Didn't the OP specifically specify that graphing calculators cannot be used?

@alexy13 OP made an exception for languages that had monochrome output and mentioned calculators as an example.

I did something similar on my Casio-7200G back in the day, that at least had subroutines of some kind :-)

@MarkJeronimus The Abs() version would be more golfy for sure.  In fact the calculator can do |x|>2.  I think when I wrote this, I was trying to optimise performance and there is an implicit sqrt() in the abs(), so the comparison I have may be faster.  Also this calculator has a Complex mode, but the plot command is not supported in that mode, so I had do do my own complex emulation in Real mode, and I don't think Abs() would be useful in that case - the zx and zy variables are supposed to be real and imaginary parts of z.

Weird about the abs function. I'm used to TI which has ABS( as a single token and runs fine when you don't use closing brackets, e.g. y←Abs(x. My program just plotted pixels in one of the Image variables, and then went to the image menu and opened it.

Only gotos? That's a recipe for some very tasty spaghetti!

I came across this the other day. I don't take credit for it, but damn, is it awesome:
Python 2:
_                                      =   (
                                        255,
                                      lambda
                               V       ,B,c
                             :c   and Y(V*V+B,B,  c
                               -1)if(abs(V)<6)else
               (              2+c-4*abs(V)**-0.4)/i
                 )  ;v,      x=1500,1000;C=range(v*x
                  );import  struct;P=struct.pack;M,\
            j  ='<QIIHHHH',open('M.bmp','wb').write
for X in j('BM'+P(M,v*x*3+26,26,12,v,x,1,24))or C:
            i  ,Y=_;j(P('BBB',*(lambda T:(T*80+T**9
                  *i-950*T  **99,T*70-880*T**18+701*
                 T  **9     ,T*i**(1-T**45*2)))(sum(
               [              Y(0,(A%3/3.+X%v+(X/v+
                               A/3/3.-x/2)/1j)*2.5
                             /x   -2.7,i)**2 for  \
                               A       in C
                                      [:9]])
                                        /9)
                                       )   )

http://preshing.com/20110926/high-resolution-mandelbrot-in-obfuscated-python/

Seems to be disallowed: the regions are not easily distinguishable, or even at all.

Also, this writes to a file.

disallowed or not, this is pretty awesome :D

@DigitalTrauma I guess we'd see more of this output if it was allowed.

@DigitalTrauma, heck, +1 for most beautiful input!

Does this count as a quine? ;-)

I'm shocked you can trick python into running something so oddly packed...

@o0'. Yeah, I'm surprised indentation didn't cause any errors here because Python is usually really picky about that.

Very very very cool.

LaTeX, 673 bytes
\countdef\!1\!129\documentclass{article}\usepackage[margin=0pt,papersize=\!bp]{geometry}\usepackage{xcolor,pgf}\topskip0pt\offinterlineskip\def~{99}\let\rangeHsb~\countdef\c2\countdef\d3\countdef\e4\begin{document}\let\a\advance\let\p\pgfmathsetmacro\makeatletter\def\x#1#2#3{#10
\@whilenum#1<#2\do{#3\a#11}}\d0\x\c{\numexpr~+1}{\expandafter\edef\csname\the\c\endcsname{\hbox{\noexpand\color[Hsb]{\the\d,1,1}\/}}\a\d23
\ifnum\d>~\a\d-~\fi}\def\/{\rule{1bp}{1bp}}\x\c\!{\hbox{\x\d\!{\p\k{4*\d/(\!-1)-2}\p\K{2-4*\c/(\!-1)}\def\z{0}\def\Z{0}\x\e~{\p\:{\z*\z-\Z*\Z+\k}\p\Z{2*\z*\Z+\K}\let\z\:\p\:{\z*\z+\Z*\Z}\ifdim\:pt>4pt\csname\the\e\endcsname\e~\fi}\ifnum\e=~\/\fi}}}\stop

 (129 × 129)

The PDF image consists of colored square units with size 1bp × 1bp.
Ungolfed
% count register \size contains the width and height of the square
\countdef\size=1
\size=31
\documentclass{article}
\usepackage[margin=0pt,papersize=\size bp]{geometry}
\usepackage{xcolor,pgf}
\topskip0pt
\offinterlineskip
\def\iterations{99}
\let\rangeHsb\iterations
\countdef\c2
\countdef\d3
\countdef\e4
\begin{document}
\let\p\pgfmathsetmacro
\makeatletter
% \Loop: for (#1 = 0; #1 < #2; #1++) {#3}
\def\Loop#1#2#3{%
  #1=0
  \@whilenum#1<#2\do{#3\advance#11}%
}
\d0%
\Loop\c{\numexpr\iterations+1\relax}{%
  \expandafter\edef\csname\the\c\endcsname{%
    \hbox{\noexpand\color[Hsb]{\the\d,1,1}\noexpand\pixel}%
  }%
  \advance\d23 \ifnum\d>\iterations\advance\d-\iterations\fi
}
\def\pixel{\rule{1bp}{1bp}}
% \c: row
% \d: column
% \e: iteration
\Loop\c\size{%
  \typeout{c: \the\c}%
  \hbox{%
    \Loop\d\size{%
      \pgfmathsetmacro\k@re{4*\d/(\size-1)-2}%
      \pgfmathsetmacro\K@im{2-4*\c/(\size-1)}%
      \def\z@re{0}%
      \def\Z@im{0}%
      \Loop\e\iterations{%
         % calculate z(n+1) = z^2(n) + k
         \pgfmathsetmacro\temp{\z@re*\z@re-\Z@im*\Z@im+\k@re}%
         \pgfmathsetmacro\Z@im{2*\z@re*\Z@im+\K@im}%
         \let\z@re\temp
         % calculate abs(z)^2
         \pgfmathsetmacro\temp{\z@re*\z@re+\Z@im*\Z@im}%
         \ifdim\temp pt>4pt\csname\the\e\endcsname\e\iterations\fi
      }%
      \ifnum\e=\iterations\pixel\fi
    }%
  }%
}
\stop

I wonder if functional shading is shorter / meets the rule (not loading the pre-defined shading but define it yourself).  Also including tikz includes both pgf and xcolor.

x86 DOS Assembly, 208 177 173 bytes
The full binary, in HEX, that I created by hand, is:
DBE3BE00A0B81300CD1056BA640007BF87F9FDBDC7008BCDE81A008AC3AA4979F7B9C70083EF784D79EE33C0CD16B80300CD10CD208BC12BC289441CDF441CDF06A701DEF9D95C088BC52BC289441CDF441CDF06A701DEF9D95C0CD9EED914D95404D95410D95C14B301D904D84C04DE0EA901D8440CD95404D94410D86414D84408D914D80CD95C10D84C04D95414D84410DF06AB01DED99BDFE09B9E7207433ADA72C632DBC3320002000400

The sample image is:

The full source in readable ASM is fairly long (I used this to figure out how I was coding this sucker):
.286
CODE SEGMENT
ASSUME CS:code, DS:code
ORG 0100h

; *****************************************************************************
start:
  ; Mandlebrot coordinates
  zr   = DWORD PTR [SI+0]
  zi   = DWORD PTR [SI+4]
  cr   = DWORD PTR [SI+8]
  ci   = DWORD PTR [SI+12]
  zrsq = DWORD PTR [SI+16]
  zisq = DWORD PTR [SI+20]

  ; Temp int
  Temp = WORD PTR  [SI+28]

  ; ===========================================================================
  ; Initialize

  ; Initialize the FPU
  FNINIT

  ; SI points to our memory
  mov si, 0A000h ; So we can push it

  ; Shave off some bytes by reusing 100
  mov dx, 100

  ; Switch to MCGA
  mov ax, 013h
  int 010h

  ; ES:DI is the end of our drawing area
  push si
  pop es
  mov di, 63879
  std ; We're using stosb backwards

  ; Initialize our X and Y
  mov bp, 199
  mov cx, bp

  ; ===========================================================================
  ; Main draw loop

MainLoop:
  ; Get our next mandelbrot value
  call GMV

  ; Store it
  mov al, bl
  stosb

  ; Decrement our X
  dec cx
  jns MainLoop

  ; Decrement our Y
  mov cx, 199
  sub di, 120
  dec bp
  jns MainLoop

  ; ===========================================================================
  ; Done

  ; Wait for a key press
  xor ax, ax
  int 016h

  ; Change back to text mode
  mov ax, 3
  int 010h

  ; Exit to DOS
  int 020h

; *****************************************************************************
; GMV: Get Mandelbrot Value
; Gets the value for the next Mandelbrot pixel
; Returns:
;   BL - The color to use
GMV:
  ; ===========================================================================
  ; Initialize

  ; cr = (x - 100) / 50;
  mov ax, cx
  sub ax, dx                  ; \
  mov Temp, ax                ;  > ST0 = Current X - 100
  FILD Temp                   ; /
  FILD Divisor                ; ST0 = 50, ST1 = Current X - 100
  FDIVP                       ; ST0 = (Current X - 100) / 50
  FSTP cr                     ; Store the result in cr

  ; ci = (y - 100) / 50;
  mov ax, bp
  sub ax, dx                  ; \
  mov Temp, ax                ;  > ST0 = Current Y - 100
  FILD Temp                   ; /
  FILD Divisor                ; ST0 = 50, ST1 = Current Y - 100
  FDIVP                       ; ST0 = (Current Y - 100) / 50
  FSTP ci                     ; Store the result in ci

  ; zr = zi = zrsq = zisq = 0;
  FLDZ
  FST zr
  FST zi
  FST zrsq
  FSTP zisq

  ; numiteration = 1;
  mov bl, 1

  ; ===========================================================================
  ; Our main loop

  ; do {
GMVLoop:

  ; zi = 2 * zr * zi + ci;
  FLD zr
  FMUL zi
  FIMUL TwoValue
  FADD ci
  FST zi ; Reusing this later

  ; zr = zrsq - zisq + cr;
  FLD zrsq
  FSUB zisq
  FADD cr
  FST zr ; Reusing this since it already is zr

  ; zrsq = zr * zr;
  ;FLD zr ; Reused from above
  FMUL zr
  FSTP zrsq

  ; zisq = zi * zi;
  ;FLD zi ; Reused from above
  FMUL zi
  FST zisq ; Reusing this for our comparison

  ; if ((zrsq + zisq) < 4)
  ;   return numiteration;
  FADD zrsq
  FILD FourValue
  FCOMPP
  FSTSW ax
  FWAIT
  sahf
  jb GMVDone

  ;} while (numiteration++ < 200);
  inc bx
  cmp bl, dl
  jb GMVLoop

  ;return 0;
  xor bl, bl

GMVDone:
  ret
;GMV

; *****************************************************************************
; Data

; Divisor
Divisor DW 50
; Two Value
TwoValue DW 2
; 4 Value
FourValue DW 4

CODE ENDS
END start

This is designed for compiling with TASM, runs in MCGA, and waits for a keypress before ending the program. The colors are just the default MCGA palette.
EDIT: Optimized it, now it draws backwards (same image though), and saved 31 bytes!
EDIT 2: To assuage the OP, I have recreated the binary by hand. By doing so, I also shaved another 4 bytes off. I documented every single step of the process, showing all of my work so anybody can follow along if they really want to, here (warning, it's boring and very long):
http://lightning.memso.com/media/perm/mandelbrot2.txt
I used a couple regex's in EditPadPro, to find all the ; Final: ... entries in the file and dump them as hex binary to a .com file. The resulting binary is what you see at the top of this post.

Someone had edited my response to say you can use Python to create the file (I guess if you don't have a hex editor). I don't use Python, but their method was: python.exe -c "open('mandel.exe', 'wb').write('[ Paste Hex Here ]'.decode('hex_codec'))"

Machine-code doesn't count. If that counts, then any language producing byte-code or machine-code should be shorter. I count 820 after changing everything to 1-character long names.

@MarkJeronimus I would guess that for most of the popular languages, small programs will get significantly larger when compiled to machine code. Always counting the full binary, of course.

I could hand code the entire thing in binary if it makes it easier for you, but that would be like asking anybody using a high level language to avoid using automatic constructs, macros, etc. That's ALL that assembly really is, just a bunch of macros.
The resulting binary to run a full JavaScript, Perl, etc. includes the binary of the library. With ASM, the final hex value is everything, libraries, ALL CODE, included.

Any computer language is a translation/mapping of a human-readable form to computer-readable form. When asking for a language, one always implies the human-readable form, in this case ASM. Have you ever seen people optimizing C, C# and Java code for smallest binary code (on this page)?

No. I can hand convert ASM to binary if really necessary. It will come out with the exact same 177 bytes that my assembler helped with. The resulting code can be pasted by anybody with a binary editor into a new file, saved out, 177 bytes, and it will work as expected. Apparently SO is divided on ASM submissions, so maybe you should clarify if you feel it does not count:
http://meta.codegolf.stackexchange.com/questions/260/should-executable-binaries-be-considered-a-reasonable-solution-for-code-golf

I can translate Basic code to assembly code if I take the time. That doesn't make it a valid submission. Read the comment on the first post of the page you linked. I'm with @AShelly. I quote: "You should be scored on the language you write in, not your compiler's output. (Unless you really are writing in raw binary...)"

Alright, so, to prove this a valid entry, I spent the time it took to hand translate this to binary. I have updated my answer accordingly.

Machine code should count if the author actually codes in it directly. I used to code directly in Z80 machine code on my ZX Spectrum in 1983. I didn't even know what an assembler was. I never transferred this skill to any other processor or platform though.
That it might be hard to decide who really wrote directly in machine code and who wrote in assembly then lied about it is an entirely separate thing.

The thing is, there is no compiler with assembly. You just use macros. Saying that it doesn't count is like saying you can't use any predefined #define statements in C. It's just time consuming to manually replace it all.

Java, 505 405 324 bytes
Just a standard calculation, with golfitude now with extra golfitude.

Golfed:
import java.awt.*;class M{public static void main(String[]v){new Frame(){public void paint(Graphics g){for(int t,s,n=640,i=n*n;--i>0;g.setColor(new Color(s*820)),g.drawLine(i/n,i%n+28,i/n,i%n),setSize(n,668)){float c=4f/n,a=c*i/n-2,b=i%n*c-2,r=a,e=b,p;for(s=t=99;t-->0&&r*r+e*e<4;s=t,p=r*r-e*e+a,e=r*e*2+b,r=p);}}}.show();}}

With line breaks:
import java.awt.*;
class M{
    public static void main(String[]v){
        new Frame(){
            public void paint(Graphics g){
                for(int t,s,n=640,i=n*n;--i>0;g.setColor(new Color(s*820)),g.drawLine(i/n,i%n+28,i/n,i%n),setSize(n,668)){
                    float c=4f/n,a=c*i/n-2,b=i%n*c-2,r=a,e=b,p;
                    for(s=t=99;t-->0&&r*r+e*e<4;s=t,p=r*r-e*e+a,e=r*e*2+b,r=p);
                }
            }
        }.show();
    }
}

f.setSize(n,668); - depends heavily on the used Theme, but I'll accept it.

You can drop the imports in Java because they're auto-generated anyway.

I also see double where float could be used if you tried

JFrame => Frame shaves off 2 chars. Although you can't close the window anymore. ;)

@MarkJeronimus Thanks for the advice, especially about imports. New to golf, so it helps. I'll be coming back to this later today, had to get some sleep ;)

Your class do not need to be public. Further, use Java 8 to get rid of the final modifier. And you must not omit the imports in order to be a complete submission.

@Victor Ah, edited the imports back in; was wondering about that. Not installing Java 8 right now, but thanks for the tip.

@Geobits After working with your other answer, I saw this answer and noticed you can make similar reductions by including setSize(..) in the frame's paint method's for-loop, which would also allow you to place n=640 in the for-loop, saving you additional bytes on the final modifier and extra int declaration.

@Vulcan Yea, I was going to get back to this one, but it's sleepy-time for now. Will hit it up in the morning. Thanks again :)

You don't need Java 8 to remove the public modifier.

@mbomb007 Which one? I removed the one from the class already. Removing the one on main allows it to compile, but not run. Removing the other won't compile.

Oh. Never mind.

Besides the golf of changing class M{public static void main to interface M{static void main when converting from Java 7 to 8, you can golf for(s=t=99;t-->0&&r*r+e*e<4;s=t,p=r*r-e*e+a,e=r*e*2+b,r=p); to for(s=t=99;t-->0&r*r+e*e<4;p=r*r-e*e+a,e=r*e*2+b,r=p)s=t; to save 2 bytes.

Javascript (ECMAScript 6) - 315 308 Characters
document.body.appendChild(e=document.createElement("canvas"));v=e.getContext("2d");i=v.createImageData(e.width=e.height=n=600,n);j=0;k=i.data;f=r=>k[j++]=(n-c)*r%256;for(y=n;y--;)for(x=0;x++<n;){c=s=a=b=0;while(c++<n&&a*a+b*b<5){t=a*a-b*b;b=2*a*b+y*4/n-2;a=t+x*4/n-2}f(87);f(0);f(0);k[j++]=255}v.putImageData(i,0,0)

(d=document).body.appendChild(e=d.createElement`canvas`);v=e.getContext`2d`;i=v.createImageData(e.width=e.height=n=600,n);j=0;k=i.data;f=r=>k[j++]=(n-c)*r%256;for(y=n;y--;)for(x=0;x++<n;){c=s=a=b=0;while(c++<n&&a*a+b*b<5){t=a*a-b*b;b=2*a*b+y*4/n-2;a=t+x*4/n-2}f(87);f(0);f(0);k[j++]=255}v.putImageData(i,0,0)

Change n to vary the image size (and number of iterations).
Change the values passed in the f(87);f(0);f(0); calls (near the end) to change the RGB colour values. (f(8);f(8);f(8); is greyscale.)

With f(8);f(23);f(87);:

(d=document).body.appendChild(e=d.createElement`canvas`);v=e.getContext`2d`;i=v.createImageData(e.width=e.height=n=600,n);j=0;k=i.data;f=r=>k[j++]=(n-c)*r%256;for(y=n;y--;)for(x=0;x++<n;){c=s=a=b=0;while(c++<n&&a*a+b*b<5){t=a*a-b*b;b=2*a*b+y*4/n-2;a=t+x*4/n-2}f(8);f(23);f(87);k[j++]=255}v.putImageData(i,0,0)

Nice. d=document would save you a few more. (Also, Is there a reason for creating the canvas? Does codegolf assume a certain level of HTML available?)

You can write document.createElement`canvas`  and save 2 bytes. Same as the getContext`2d` .

I didn't assume a HTML Canvas as this is a pure JavaScript solution.

or you can 'drop' canvas at all like here

The first image looks like a Virtual Boy game.

Mathematica, 214 191 215 19 30
Since version 10.0 there is a built-in: (19 bytes)
MandelbrotSetPlot[]

To conform to the coordinate range requirements, 11 additional bytes are required.  (30 bytes)
MandelbrotSetPlot@{-2-2I,2+2I}

A hand-rolled case:
m=Compile[{{c,_Complex}},Length[FixedPointList[#^2+c&,0,99,SameTest→(Abs@#>=2&)]]];
ArrayPlot[Table[m[a+I b],{b,-2,2,.01},{a,-2,2,.01}],DataRange→{{-2,2},{-2,2}},
ColorRules→{100→Black},ColorFunction→(Hue[Log[34,#]]&)]

{b, -2, 2, .01}, {a, -2, 2, .01} is shorter and closer to the rules

@MarkJeronimus Thanks. I used the suggested range for the iterating picture.

You had it almost right, then you made the inside non-black. The last frame in the GIF is black inside and an allowed answer. EDIT: and I count 195 bytes.

I missed the point about being black.  The count increased because some single characters became two characters in the cut-and-paste to SE.

Your built-in solution uses a very loose interpretation of The fractal coordinates range from approximately -2-2i to 2+2i.

@JonathanFrech, Yes, thanks.

J, 73 bytes
load'viewmat'
(0,?$~99 3)viewmat+/2<|(j./~i:2j479)(+*:) ::(3:)"0^:(i.99)0

Edit, some explaining:
x (+*:) y           NB. is x + (y^2)
x (+*:) ::(3:) y    NB. returns 3 when (+*:) fails (NaNs)
j./~i:2j479         NB. a 480x480 table of complex numbers in required range
v =: (j./~i:2j479)(+*:) ::(3:)"0 ]     NB. (rewrite the above as one verb)
v z0                NB. one iteration of the mandelbrot operation (z0 = 0)
v v z0              NB. one iteration on top of the other
(v^:n) z0           NB. the result of the mandelbrot operation, after n iterations
i.99                NB. 0 1 2 3 4 ... 98
(v^:(i.99))0        NB. returns 99 tables, one for each number of iterations
2<| y               NB. returns 1 if 2 < norm(y), 0 otherwise
2<| (v^:(i.99))0    NB. 99 tables of 1s and 0s
+/...               NB. add the tables together, element by element.
NB. we now have one 480x480 table, representing how many times each element exceeded norm-2.
colors viewmat M    NB. draw table 'M' using 'colors'; 'colors' are rgb triplets for each level of 'M'.
$~99 3              NB. 99 triplets of the numbers 99,3
?$~99 3             NB. 99 random triplets in the range 0 - 98 and 0 - 2
0,?$~99 3           NB. prepend the triplet (0,0,0): black

+1 but would it be possible for you to explain a little how that code work? In particular i m curious to know how (where in the code) does it pick the colors?

@MarkJeronimus, I can make it 70 but I kept some things for clarity. I, thus, took the liberty to ignore the LF when counting.

@plannapus, OK, added some comments. The color picking is done with (0,?$~99 3) which produces 100 rgb triplets, one for each level. Because of the randomness, you might get less than 100 triplets so some levels will have a smoother transition (but still have different colors).

Python with Pylab+Numpy, 151 bytes
I couldn't bear to see a non-DQ'ed Python entry, but I think I really outdid myself on this one, and I made it down to 153 characters!
import numpy as n
from pylab import*
i=99
x,y=n.mgrid[-2:2:999j,-2:2:999j]
c=r=x*1j+y
x-=x
while i:x[(abs(r)>2)&(x==0)]=i;r=r*r+c;i-=1
show(imshow(x))

Also, notably, the second to last line raises 4 distinct runtime warnings, a new personal record!

I count 152. No space is required between import and *, and not defining f at all should be shorter, unless i've misunderstood something, which is possible. You should also change it around such that 0 iterations and 1 iterations are distiguished (they're currently both grey).

Weird.  Does wc include the eof?  Fixed and slightly smaller.  Just a moment.

I get 151 with wc.  First golf, so not sure how to score it.

I count 150, without trailing newline. Some interpreters/compilers demand one, but the python interpreter does fine without. Not sure about wc, but maybe try stat -c %s instead. Are the black upper and lower borders part of the image?

150 here too. Besides, you sure it's 640 or less wide, and not 999? The image looks antialiased

I cropped out of the figure matplotlib draws using my desktop in gimp, so the image size might be derped somehow.  It is doing 999 now, but changing that to anything 640x640 will look basically the same, and have the same char count.  I will fix when I get home tonight and recrop w/ pic count in the borders.

You can save 1 character by using from numpy import* instead of import numpy as n and mgrid instead of n.mgrid.

C + Allegro 4.2.2 - 248 bytes
#include<allegro.h>
x=-1,y,K=400;float a,h,c,d,k;main(i){set_gfx_mode('SAFE',K,K,allegro_init(),0);while(x++<K)
for(y=0;y<K;y++){for(a=h=i=0;a*a+h*h<4&&++i<256;k=a,a=a*a-h*h+x*0.01-2,h=2*k*h+y*0.01-2);
putpixel(screen,x,y,i);}while(1);}END_OF_MAIN()

Output:

You should mention that this is Allegro 4 (which is quite different from Allegro 5). Which exact version is this?

it's either 246 or 249 long

@Victor Allegro 4.2.2.

@MarkJeronimus Notepad++ tells me it's 248 characters long.

Notepad++ is wrong. http://i.imgur.com/vnRMzOj.png

@MarkJeronimus Isn't there supposed to be a newline between ... allegro.h> and x=-1, ...? I suppose Notepad++ counts it as \r\n = 0D 0A.

247 characters for me if I remove newlines except for the one after #include <allegro.h>. http://bpaste.net/show/z45cZWcn5qTKSBZ8YN9e/

I think 0.01 can be typed as .01.

Windows PowerShell (v4), 299 bytes

# Linewrapped here for show:

$M='System.Windows.Forms';nal n New-Object;Add-Type -A System.Drawing,$M;(
$a=n "$M.Form").backgroundimage=($b=n Drawing.Bitmap 300,300);0..299|%{
$r=$_;0..299|%{$i=99;$k=$C=n numerics.complex($_/75-2),($r/75-2);while(((
$k=$k*$k).Magnitude-lt4)-and$i--){$k+=$C}$b.SetPixel($_,$r,-5e6*++$i)}};$a.Show()

# The single line 299 char entry version:

$M='System.Windows.Forms';nal n New-Object;Add-Type -A System.Drawing,$M;($a=n "$M.Form").backgroundimage=($b=n Drawing.Bitmap 300,300);0..299|%{$r=$_;0..299|%{$i=99;$k=$C=n numerics.complex($_/75-2),($r/75-2);while((($k=$k*$k).Magnitude-lt4)-and$i--){$k+=$C}$b.SetPixel($_,$r,-5e6*++$i)}};$a.Show()

Instructions

Run a normal PowerShell console (ISE might not work)
Copy/paste code in, press Enter
Wait - it takes a minute or more to run
The only way to quit is to close the console

Comment

There's a tiny bit of rule-testing going on with the colours inside the set; the rules say "The other pixels (presumably inside the Mandelbrot set) must be colored either black or white'"; the code is colouring the pixels completely black RGB(0,0,0) ... it just happens to be a transparent black RGBA(0,0,0,0). So what shows up is the form background colour of the current Windows theme, a slightly off-white RGB(240,240,240) in this case.

I'd change lt2 to lt4 to make it a "mandelbrot set" instead of the image you have now, Many points of the set are swallowed up by the color bands.

Apparently Magnitude is a*a+b*b not sqrt(a*a+b*b)

I thought I tested that earlier, but I went in search of an answer to "where's the horizontal line on the left gone?", and after a bit, I found it exactly where you said, -lt4. Which is good - thank you. I've updated my answer with corrected code, and image. (Will have to rethink my understanding of what it's doing, since I'm missing something).

Python + PIL, 166 bytes
import Image
d=600;i=Image.new('RGB',(d,d))
for x in range(d*d):
 z=o=x/9e4-2-x%d/150.j-2j;c=99
 while(abs(z)<2)*c:z=z*z+o;c-=1
 i.putpixel((x/d,x%d),5**8*c)
i.show()

Output (will open in the default *.bmp viewer):

You can shave off 3 if you get rid of the y loop. r=range(d*d), use x/d and x%d for x and y.

@Geobits the idea actually saved 10, thanks!

Complex types can be initialized like: c=1+2j, which I think would save you a couple characters with: z=o=x/9e4-2+(x%d/150.-2)*1j;c=99

@meawoppl another 7 :D

Technically disallowed: this doesn't any graphical output feature of Python itself (and Image.show() implicitly saves a temporary file).

This post totally got me started on the 153 character version I posted below :)

Works in Python 3 at the cost of one additional byte: x//d instead of x/d in the putpixel line.

BBC Basic (228 bytes)
What about languages that nobody ever heard of in code golf? Most likely could be optimized, but I'm not quite where - improvements possible. Based of http://rosettacode.org/wiki/Mandelbrot_set#BBC_BASIC, but I tried to code golf it as much as possible.
VDU23,22,300;300;8,8,8,8
ORIGIN0,300
GCOL1
FORX=0TO600STEP2
i=X/200-2
FORY=0TO300STEP2
j=Y/200
x=0
y=0
FORI=1TO128
IFx*x+y*y>4EXIT FOR
t=i+x*x-y*y
y=j+2*x*y
x=t
NEXT
COLOUR1,I*8,I*4,0
PLOTX,Y:PLOTX,-Y
NEXT
NEXT

The > symbol on image is prompt, and it's automatically generated after running the program.

No need to plot twice, just go with a more inefficient version. Doesn;t it support NEXT Y,X?

APL, 194 chars/bytes*
m←{1{⍺=99:0⋄2<|⍵:⍺⋄(⍺+1)∇c+⍵*2}c←⍵}¨⍉v∘.+0j1×v←¯2+4÷s÷⍳s←640
'F'⎕WC'Form'('Coord' 'Pixel')('Size'(s s))
'B'⎕WC'Bitmap'('CMap'(0,,⍨⍪0,15+10×⍳24))('Bits'(24⌊m))
'F.I'⎕WC'Image'(0 0)('Picture' 'B')

This is for Dyalog APL with ⎕IO ⎕ML←1 3
Most of the space is taken by API calls to show a bitmap in a window (lines 2, 3, 4)
If there was a shortcut to do it, the code would be down to 60 chars (line 1)
Ungolfed version (only line 1)
s←640            ⍝ size of the bitmap
v←(4×(⍳s)÷s)-2   ⍝ vector of s reals, uniform between ¯2 and 2
m←(0j1×v)∘.+v    ⍝ square matrix of complex numbers from ¯2j¯2 to 2j2
m←{              ⍝ transform each number in matrix m according to the following
  1{             ⍝   function that takes iteration counter as ⍺ and current value as ⍵
    ⍺=99: 0      ⍝     if we have done 99 iterations, return 0
    2<|⍵: ⍺      ⍝     if |⍵| > 2 return the number of iterations done
    (⍺+1)∇c+⍵*2  ⍝     otherwise, increment the iterations and recurse with the new value
  }c←⍵           ⍝   save the initial value as c
}¨m

Screenshot:

*: Dyalog has its own single byte charset, with the APL symbols mapped to the upper 128 byte values, so the entire code can be stored in 194 bytes.

R, 199 211 characters
Old solution at 199 characters:
r=seq(-2,2,l=500);c=t(sapply(r,function(x)x+1i*r));d=z=array(0,dim(c));a=1:25e4;for(i in 1:99){z[a]=c[a]+z[a]^2;s=abs(z[a])<=2;d[a[!s]]=i;a=a[s]};image(d,b=0:99,c=c(1,sample(rainbow(98))),ax=F,asp=1)

With indentation:
r=seq(-2,2,l=500)
c=t(sapply(r,function(x)x+1i*r)) #Produces the initial imaginary number matrix
d=z=array(0,dim(c)) #empty matrices of same size as c
a=1:25e4            #(z will store the magnitude, d the number of iterations before it reaches 2)
for(i in 1:99){     #99 iterations
    z[a]=c[a]+z[a]^2
    s=abs(z[a])<=2
    d[a[!s]]=i
    a=a[s]
    }
image(d,b=0:99,c=c(1,sample(rainbow(98))),ax=F,asp=1) #Colors are randomly ordered (except for value 0)

Edit: Solution at 211 characters that colors the inside of the set and the outside of the first layer differently:
r=seq(-2,2,l=500);c=t(sapply(r,function(x)x+1i*r));d=z=array(0,dim(c));a=1:25e4;for(i in 1:99){z[a]=c[a]+z[a]^2;s=abs(z[a])<=2;d[a[!s]]=i;a=a[s]};d[a[s]]=-1;image(d,b=-1:99,c=c(1:0,sample(rainbow(98))),ax=F,asp=1)

With indentation:
r=seq(-2,2,l=500)
c=t(sapply(r,function(x)x+1i*r))
d=z=array(0,dim(c))
a=1:25e4
for(i in 1:99){
    z[a]=c[a]+z[a]^2
    s=abs(z[a])<=2
    d[a[!s]]=i
    a=a[s]
    }
d[a[s]]=-1 #Gives the inside of the set the value -1 to differenciate it from value 0.
image(d,b=-1:99,c=c(1,sample(rainbow(99))),ax=F,asp=1)

technically black on the outside is disallowed. Did you miss that or is it difficult to implement?

@MarkJeronimus both actually :) I'll try to have a look of how to do that but i m not 100% confident that I ll find a way to do that cleanly.

@MarkJeronimus Done!

Second place in the hideous colors division.

@meawoppl blame rainbow() :)

Java - Processing (271 bytes)
void setup(){int h=100,e=5*h,i;float d,v,w,a,b,c;size(e,e);colorMode(HSB,h);loadPixels();d=4./e;v=2;for(int x=1;x<=e;x++){v-=d;w=2;for(int y=0;y<e;){w-=d;a=b=c=0;i=-1;while(a*a+b*b<4&&++i<h){c=a*a-b*b+v;b=2*a*b+w;a=c;}pixels[e*++y-x]=color(i*9%h,h,h-i);}}updatePixels();}

Expanded:
void setup(){
  int h=100, e=5*h, i; //init of size "e", max hue "h", iterator "i"
  float d,v,w,a,b,c; //init of stepwidth "d", y-coord "v", x-coord "w", Re(z) "a", Im(z) "b", temp_a "c"
  size(e,e);
  colorMode(HSB,h);
  loadPixels();
  d = 4./e;
  v = 2;
  for(int x = 1; x <= e; x++){
    v -= d;
    w = 2;
    for(int y = 0; y < e;){
      w -= d;
      a = b = c = 0;
      i = -1;
      while(a*a + b*b < 4 && ++i < h){
        c = a*a - b*b + v;
        b = 2*a*b + w;
        a = c;
      }
      pixels[e * ++y - x] = color(i*9 % h, h, h-i);
    }
  }
  updatePixels();
}

Aw, maaaaan, I wanted to do this. +1.

Mathematica 10.0, 19 chars
MandelbrotSetPlot[]

MandelbrotSetPlot is a new function in Mathematica 10.0.

How convenient, that this built in function just happens to satisfy all my requirements (except location, which can be set with 13 more characters). Except this is a standard loophole.

Code golf is generally won by specialist languages with single-character tokens, or by systems like Mathematica that have a massive number of special functions built-in. To use them is not cheating, any more than using single-character commands would be in APL.

TI-80 BASIC, 125 106 bytes
ZDECIMAL
FOR(Y,-2,2,.1
FOR(X,-2,2,.1
0->S
0->T
1->N
LBL N
N+1->N
IF S²+T²≥4
GOTO B
S²-T²+X->I
2ST+Y->T
I->S
IF N<20
GOTO N
LBL B
IF FPART (N/2
PT-ON(X,Y
END
END

Based on Digital Trauma's answer.

Applesoft BASIC, 302 286 280 bytes
This picks random points to draw, so it will run forever and may never fill in the full plane.
1HGR:POKE49234,0:DIMco(10):FORc=0TO10:READd:co(c)=d:NEXT:DATA1,2,3,5,6,1,2,3,5,6,0
2x=INT(RND(1)*280):y=INT(RND(1)*96):x1=x/280*3-2:y1=y/191*2-1:i=0:s=x1:t=y1
3s1=s*s-t*t+x1:t=2*s*t+y1:s=s1:i=i+1:IFs*s+t*t<4ANDi<20THENGOTO3
4c=co(i/2):IFc THENHCOLOR=c:HPLOTx,y:HPLOTx,191-y
5GOTO2

Turns out Applesoft BASIC is really forgiving about lack of spaces. Only one space is necessary in the entire program.
Output after 14 hours:

GIF:

Before golfing:
10 HGR : POKE 49234,0
20 DIM co(10) : FOR c = 0 TO 10 : READ d : co(c) = d : NEXT
30 DATA 1, 2, 3, 5, 6, 1, 2, 3, 5, 6, 0
100 x = INT(RND(1) * 280) : y = INT(RND(1) * 96)
110 x1 = x / 280 * 3 - 2 : y1 = y / 191 * 2 - 1
120 i = 0:s = x1:t = y1
130 s1 = s * s - t * t + x1
140 t = 2 * s * t + y1:s = s1: i = i + 1
150 IF s * s + t * t < 4 AND i < 20 THEN GOTO 130
160 c = co(i/2) : IF c THEN HCOLOR= c : HPLOT x,y : HPLOT x,191 - y
170 GOTO 100

Note: POKE 49234,0 (in Applesoft BASIC) puts the machine into full graphics mode.
A version optimized for B&W displays:
110 HGR:POKE 49234,0:HCOLOR=3
120 FOR x = 0 TO 279:FOR y = 0 TO 95
130 x1 = x / 280 * 3 - 2:y1 = y / 191 * 2 - 1
140 i = 0:s = x1:t = y1:c = 0
150 s1 = s * s - t * t + x1
160 t = 2 * s * t + y1:s = s1:c = 1 - c:i = i + 1
170 IF s * s + t * t < 4 AND i < 117 THEN GOTO 150
180 IF c = 0 THEN HPLOT x,y:HPLOT x,191 - y
190 NEXT:NEXT

Output after 12 hours:

A version that will work in GW-BASIC (DOS):
5 CLS
6 SCREEN 1
20 DIM co(10) : FOR c = 0 TO 10 : READ d : co(c) = d : NEXT
30 DATA 1, 2, 3, 5, 6, 1, 2, 3, 5, 6, 0
100 x = INT(RND(1) * 280) : y = INT(RND(1) * 96)
110 x1 = x / 280 * 3 - 2 : y1 = y / 191 * 2 - 1
120 i = 0 : s = x1 : t = y1
130 s1 = s * s - t * t + x1
140 t = 2 * s * t + y1 : s = s1 : i = i + 1
150 IF s * s + t * t < 4 AND i < 20 THEN GOTO 130
160 c = co(i/2) : PSET (x,y),C : PSET (x,191 - y),C
170 GOTO 100

Would be smaller (and slower) if you didn't plot two pixels at once but choose a random pixel on the entire screen.

@MarkJeronimus It's already so slow that the color version has not yet finished, after posting this 5 days ago. I don't think I can afford it to be any slower :P

R, 140 136 128 124 123 110 109 bytes*
image(outer(j<-1:396/99-2,j,Vectorize(function(x,y,n=99){while((n=n-1)&abs(F)<2)F=F*F+x+1i*y;n})),c=colors())

Try it at rdrr.io
6y after the Q was asked, but I love Mandelbrot sets, and the earlier R solution was 211 characters...

*Or just 62 bytes as a pixel-shader function in R≥4.1:
\(x,y,n=99){while((n=n-1)&abs(F)<2)F=F*F+x+1i*y;colors()[n+1]}

No problem, submissions are always welcome. En welkom.

JavaScript, 284 283 ...(12 improvements)...  191 190 188 199 bytes
currenty (2019-10-05) this is shortest js solution (the shortest one before this has 285 bytes)

Expanded

// Fractal calculations
c=512;

// p has pixels, p+= allways join 4 digit number implicit casted to string
// 4 char string interpred as base64 gives 3bytes = 1 RGB pixel
for( p=i=''; j=x=y=0,++i<=c*c; p+= j<c ? 9*c+9*j : 'AAAA' )
  while( x*x+y*y<4 && ++j-c )
    [x,y] = [ x*x-y*y+i%c/128-2, 2*x*y+i/c/128-2 ];

// draw pixels in 512x512 BMP base64 image
document.write("<img src=data:;base64,Qk0bAAwAAAAAABsAAAAMAAAAAAIAAgEAGAAA"+p)

After small constans changes

c=512;for(p=i='';j=x=y=0,++i<=c*c;p+=j<c?2*c+9*j:'AAAA')while(x*x+y*y<4&&++j-c)[x,y]=[x*x-y*y+i%c/128-2,2*x*y+i/c/128-2]
document.write("<img src=data:;base64,Qk0bAAwAAAAAABsAAAAMAAAAAAIAAgEAGAAA"+p)

This is very cool, but the pixels inside the set should be black or white. I'm not sure what either of those are in base 64

@MatthewJensen you are right - AAAA - fixed

A few minor changes gets 194 bytes for(c=i=512,p='<img src=data:;base64,Qk0bAAwAAAAAABsAAAAMAAAAAAIAAgEAGAAA';i++<c*c;p+=j<c?9*c+9*j:'AAAA')for(j=x=y=0;x*x+y*y<4&&++j-c;)[x,y]=[x*x-y*y+i%c/128-2,2*x*y+i/c/128-2];document.write(p)

Octave (212 136 bytes)
(Now including some ideas due to @ChrisTaylor.)
[y,x]=ndgrid(-2:.01:2);z=c=x+i*y;m=c-c;for n=0:99;m+=abs(z)<2;z=z.^2+c;end;imagesc(m);colormap([hsv(128)(1+mod(0:79:7890,128),:);0,0,0])

With whitespace:
[y,x] = ndgrid(-2:.01:2);
z = c = x + i*y;
m = c-c;
for n=0:99
    m += abs(z)<2;
    z = z.^2 + c;
end
imagesc(m)
colormap([hsv(128)(1+mod(0:79:7900,128),:);
          0,0,0])

Output:

To convert to Matlab, change "m+=abs(z)<2" to "m=m+(abs(z)<2)". [+3 bytes]
To make the aspect ratio 1:1, add ";axis image". [+11 bytes]
My first answer (212 bytes):
[x,y]=meshgrid(-2:.01:2);z=c=x+i*y;m=0*e(401);for n=0:99;m+=abs(z)<2;z=z.^2+c;endfor;t=[0*e(1,7);2.^[6:-1:0]];[s{1:7}]=ndgrid(num2cell(t,1){:});t=1+sum(cat(8,s{:}),8);imagesc(m);colormap([hsv(128)(t(:),:);0,0,0])

There's probably a shorter way to get a discontinuous colormap....

Yes, much better now.

+1 nice and concise solution. But your aspect ratio is not 1:1 (cf. rule n°2: output should be square).

Fixing the aspect ratio will take 11 more bytes: append ";axis image".  Is that required to qualify?

i think it was just me nitpicking :) , the OP doesn't seem to have a problem with it since he didn't say anything.

Comment from user Martin Novy: "m=c-c; can be shortened to m=0; ... it works the same in this program, I have just tested it in Octave"

GLSL - 225 bytes:
void main(){vec2 c=gl_FragCoord.xy/iResolution.y*4.-2.,z=c,v;for(int i=0;i<99;i++){z=vec2(z.x*z.x-z.y*z.y,2.*z.x*z.y)+c;if(length(z)>2.&&v.y<1.)v=vec2(float(i)/99.,1.);}gl_FragColor=(v.y<1.)?vec4(v,v):texture2D(iChannel0,v);}

Defining variables in the code (242 bytes):
uniform vec3 r;uniform sampler2D t;void main(){vec2 c=gl_FragCoord.xy/r.y*4.-2.,z=c,v;for(int i=0;i<99;i++){z=vec2(z.x*z.x-z.y*z.y,2.*z.x*z.y)+c;if(length(z)>2.&&v.y<1.)v=vec2(float(i)/99.,1.);}gl_FragColor=(v.y<1.)?vec4(v,v):texture2D(t,v);}

See it in ShaderToy

This requires a suitable palette texture be loaded as iChannel0. (The colouring here is from the "random pixel" texture on ShaderToy).

Variable declarations should be counted too, unless they can be auto-generated from the code. (color scheme is fine if it's only available as an external setting)

@MarkJeronimus: For the ShaderToy environment, these variables are fixed. Otherwise, for standard shaders, I would have picked shorter variable names.

Is this the fastest of them all?

PostScript, 290 285 282 271 261 bytes
Screenshot:

Golfed code:
-2 .01 2{/a exch def -2 .01 2{/b exch def/x 0 def/y 0 def 0 1 99{/i exch def x x mul y y mul add 4 ge{i log 2 div 1 1 sethsbcolor a 2 add 100 mul b 2 add 100 mul 1 1 rectfill exit}if/x x x mul y y mul sub a add/y 2 x mul y mul b add def def}for}for}for showpage

Ungolfed code:
-2 .01 2 {
    /a exch def
    -2 .01 2 {
        /b exch def
        /x 0 def
        /y 0 def
        0 1 99 {
           /i exch def                       % iteration count
           x x mul y y mul add 4 ge {
               i log 2 div 1 1 sethsbcolor   % rainbow colors outside
               a 2 add 100 mul
               b 2 add 100 mul 1 1 rectfill
               exit
           } if
           /x x x mul y y mul sub a add
           /y 2 x mul y mul b add
           def def
       } for
    } for
} for
showpage

Golfed some more for 198 bytes: [/d{-2 .01 2}(]){exch def}([){mul}/p{add}/s{2 p 100[}/q{x x[y y[}>>begin d{/a]d{/b]0/x 0/y]]0 1 99{q p 4 ge{log .5[1 1 sethsbcolor a s b s 1 1 rectfill exit}if q sub a p 2 x[y[b p/y]/x]=}for}for}for

gnuplot 110 (105 without newlines)
Obligatory gnuplot entry. It's been done countless times but this one is from scratch (not that it's difficult). I like how gnuplot golfs its commands intrinsically :)
f(z,w,n)=abs(z)>2||!n?n:f(z*z+w,w,n-1)
se vi map
se si sq
se isos 256
sp [-2:2] [-2:2] f(0,x+y*{0,1},99) w pm

ungolfed:
f(z,w,n)=abs(z)>2||n==0?n:f(z*z+w,w,n-1)
set view map
set size square
set isosamples 256
splot [-2:2] [-2:2] f(0,x*{1,0}+y*{0,1},99) with pm3d

However, I'm DEEPLY disappointed at the entry of complex numbers. x*{1,0}+y*{0,1} must be the saddest existing way of constructing a complex number.
Oops, the image:

Set isosamples higher for better resolution. We could also say unset tics and unset colorbox for a pure image, but I think this version qualifies just fine.

Bet it's copy/pasta from the first google hit "gnuplot mandel". For starters, *{1,0} is unity and is more like a code-bowling way of saying *1, and probably can be dropped. (untested)

No it's not a copy-paste. It's a very straight forward formula and it wasn't even necessary to search for it. However, I did find the pages you get with that search when I was looking for a better way of initializing complex numbers (their implementation is different, well, as different as it can be in this case).
Thanks for the tip about the real part, it works. Fixing.

Matlab (89 bytes)
[X,Y]=ndgrid(-2:.01:2);C=X+i*Y;Z=C-C;K=Z;
for j=1:99,Z=Z.*Z+C;K=K+(abs(Z)<2);end,imagesc(K)

Output -

Doesn't satisfy the requirement that the inner cells must be black or
white, but that can be satisfied by either (1) using imshow(K) instead
of imagesc(K) (requires 1 fewer byte but needs the image processing
toolbox) or (2) appending colormap hot (requires 12 more bytes).
Ungolfed version -
Z = zeros(N);
K = Z;

[X,Y]=ndgrid(-2:.01:2);
C = X+1i*Y;

for j = 1:99
  Z = Z.*Z + C;
  K(K==0 & abs(Z) > 2) = j;
end

imagesc(K)

Using a library is fine if it's packaged in Matlab by default and any user can guess it's being used from the code or the error messages.

Nice, you beat me.  I like the C-C in place of my 0*e(401).  Plus, you're not using N.  And we can get a little shorter using my m+=abs(z)<2 idea in place of your K(~K&abs(Z)>2)=j.

The default colormap jet and colormap hot are both incorrect though - they only have 64 distinct colors.  colormap(hot(101)) doesn't look visually distinguishable to me.  colormap([0,0,0;jet(100)]) is maybe acceptable but iffy.

Does that work?  On Octave, K=K+abs(Z)<2 means K=((K+abs(Z))<2).  (So I was wrong about the one byte estimate to eliminate +=.)

Ah, good point! Edited.

Shouldn't this image be rotated -90 degrees?

The Mandelbrot set rotated by 90 degrees is still the Mandelbrot set.

Floater, 620 pixels
A language I made up when I got inspired by my own challenge, as well as from the esoteric language Piet.

Link to a language and description of the code? Or actually, what is the code?

Excel VBA, 251 246 224 223 221 bytes
Saved 5 bytes thanks to ceilingcat
Saved 23 bytes thanks to Taylor Scott
Sub m
D=99
For x=1To 4*D
For y=1To 4*D
p=0
q=0
For j=1To 98
c=2*p*q
p=p^2-q^2-2+(x-1)/D
q=c+2+(1-y)/D
If p^2+q^2>=4Then Exit For
Next
j=-j*(j<D)
Cells(y,x).Interior.Color=Rnd(-j)*1E6*j/D
Next y,x
Cells.RowHeight=48
End Sub

Output:

I made a version that did this a long time ago but it had a lot of extras like letting the user pick the basic color and easy-to-follow math. Golfing it way down was an interesting challenge. The Color method uses 1E6 as a means to get a wide range of colors since the valid colors are 0 to 2^24. Setting it to 10^6 gave nice contrast areas.
Explanation / Auto-Formatting:
Sub m()

    'D determines the number of pixels and is factored in a few times throughout
    D = 99
    For x = 1 To 4 * D
    For y = 1 To 4 * D
        'Test to see if it escapes
        'Use p for the real part and q for the imaginary
        p = 0
        q = 0
        For j = 1 To 98
            'This is a golfed down version of complex number math that started as separate generic functions for add, multiple, and modulus
            c = 2 * p * q
            p = p ^ 2 - q ^ 2 - 2 + (x - 1) / D
            q = c + 2 + (1 - y) / D
            If p ^ 2 + q ^ 2 >= 4 Then Exit For
        Next

        'Correct for no escape
        j = -j * (j < D)

        'Store the results
        'Rnd() with a negative input is deterministic
        'This is what gives us the distinct color bands
        Cells(y, x).Interior.Color = Rnd(-j) * 1000000# * j / D

    Next x, y

    'Resize for pixel art
    Cells.RowHeight = 48

End Sub

I also played around with D=999 and j=1 to 998 to get a much larger and more precise image. The results are irrelevant to the challenge because they're way too large but they are neat.

@ceilingcat Thanks. That was a carryover from my original which had specialized functions for complex number math.

Does it really need to be >=4 or can you get away with >4? Also, can replace j<99 with j<D.

@EngineerToast you can drop the () from the sub name,you should change (j<99) to (j<d) and you can, for the purpose of making square cells use only Cells.RowHeight=48 in place of the Cells.RowHeight=9,Cells.ColumnWidth=1 - this does making messing around with your output more difficult but has been accepted as valid by the community -

@TaylorScott I remember the RowHeight trick from the VBA tips post and had meant to integrate it after I got all my pretty pictures. That was a nice chunk'o'bytes, thanks.

I believe that you can get away with removing another byte by swapping 2^20 with 1E6

JavaScript + HTML5 (356B)
(Note: lines ending with '//' are added here for some readability)
Performant version (375B):
<body onload='var
w,h=w=C.width=C.height=500,X=C.getContext("2d"),I=X.createImageData(w,h),D=I.data, //
y=0,f=255,T=setInterval(function(x,i,j,k,l,c,o){for(x=0;x<w;){                     //
for(i=x*4/w-2,j=y*4/h-2,k=l=0,c=f;--c&&k*k+l*l<4;)t=k*k-l*l+i,l=2*k*l+j,k=t
D[o=(y*w+x++)*4]=(c*=0xc0ffeeee)&f
D[++o]=c>>8&f
D[++o]=c>>16&f
D[++o]=f}X.putImageData(I,0,0)
++y-h||clearInterval(T)},0)'><canvas id=C>

Slow version (356B): remove the 'var' and parameters in the inner function so that the global scope is used.
Try it out: http://jsfiddle.net/neuroburn/Bc8Rh/

Forgive me if I don't understand your instructions on making the short version.

No problem.  Remove var w, at the beginning, and change function(x,i,j,k,l,c,o) to function().

Javascript, 285B
Based off my code and some improvements on MT0's code, I've got this down to 285B in colour:
document.body.appendChild(V=document.createElement('Canvas'));j=(D=(X=V.getContext('2d')).createImageData(Z=V.width=V.height=255,Z)).data;for(x=Z*Z;x--;){k=a=b=c=0;while(a*a+b*b<4&&Z>k++){c=a*a-b*b+4*(x%Z)/Z-3;b=2*a*b+4*x/(Z*Z)-2;a=c;}j[4*x]=99*k%256;j[4*x+3]=Z;}X.putImageData(D,0,0);

in action: http://jsfiddle.net/acLhe/7/
was: Coffeescript, 342B
document.body.appendChild V=document.createElement 'Canvas'
N=99
Z=V.width=V.height=400
P=[]
P.push "rgba(0,0,0,"+Math.random()*i/N+')' for i in [N..0]
X=V.getContext '2d'
for x in [0..Z]
 for y in [0..Z]
  k=a=b=0
  [a,b]=[a*a-b*b+4*x/Z-3,2*a*b+4*y/Z-2] while a*a+b*b<4 and N>k++
  X.fillStyle=P[k-1]
  X.fillRect x,y,1,1

Coffeescript is supposed to be readable :-/ see it in action: http://jsfiddle.net/acLhe/6/

OP asks for color unless your platform doesn't support color. Looks great, though, and nice concise code. Welcome to PPCG!

I start from this size 285B and improve it more in this answer

QBasic, QuickBasic, QB64 - 156 153
SCREEN 13
FOR J=0TO 191
B=J/48-2
FOR I=0TO 191
A=I/48-2
X=A
Y=B
C=0
DO
U=X*X
V=Y*Y
Y=2*X*Y+B
X=U-V+A
C=C+1
LOOP UNTIL C>247OR U+V>4
PSET(I,J),C
NEXT
NEXT

Standard DOS palette:

QBasic, 139 bytes
-1 c/o DLosc
SCREEN 13
FOR i=0TO 199
FOR j=0TO 199
x=0
y=0
FOR c=0TO 255
t=y*y
c=c-255*(x*x+t>4)
y=2*x*y+j/50-2
x=x*x-t+i/50-2
NEXT
PSET(i,j),c
NEXT j,i

Output:

It may be necessary to append a INPUT$(1) to prevent the window from closing until a key is pressed.

FreeBASIC, 139 bytes
Using FreeBASIC's SCREEN 16, we can generate a more detailed image at the same code length:
SCREEN 16
FOR i=0TO 383
FOR j=0TO 383
x=0
y=0
FOR c=0TO 255
t=y*y
c=c-255*(x*x+t>4)
y=2*x*y+j/96-2
x=x*x-t+i/96-2
NEXT
PSET(i,j),c
NEXT j,i

Compile as fbc -lang qb mandel.bas.

Higher resolutions are also available.

Please count newlines as a byte too

@MarkJeronimus my mistake, I though I had.

Modifying c to exit the FOR loop is really clever! You can save 2 bytes by using y*y directly instead of assigning to t, and one more byte by writing NEXT j,i instead of NEXT twice. (Not sure if that second one works in FreeBASIC.)

The assignment to t is necessary, because the old value of y is used in the computation of x. Thanks for the multi-NEXT tip ;)

Perl + GD, 264
$I=new GD::Image $s=499,$s;Z(0,0,0);Z(map rand 256,1..3)for
0..99;for$x(0..$s){for$y(0..$s){for($H=$K=$c=$t=0;$c++<99&&$H*$H+$K*$K<4;){sub
Z{$I->colorAllocate(@_)}($H,$K)=($H*$H-$K*$K+4*$x/$s-2,2*$H*$K+4*$y/$s-2)}use
GD;$I->setPixel($x,$y,$c<99&&$c)}}print $I->png

Golfed from this code

Nominated: most ugly color scheme.

Tcl/Tk, 316
322 324 336 348 349 351 352 353 354 355
Now a shorter version using 3 letter #RGB shorthands style color triplets (instead of #RRGGBB triplets), which results in different colors.
And some more golfing.
rename set s
grid [canvas .c -w 640 -he 640]
.c cr i 320 320 -i [s p [image c photo -w 640 -h 640]]
time {incr x
s y 0
time {incr y
s a 0
s b 0
s n 0
while \$n<99 {s A [expr $a*$a-$b*$b+$x[s f *4/639.-2]]
if [s b [expr 2*$a*$b+$y$f]]*$b+[s a $A]*$a>4 break
incr n}
$p p [format #%03x [expr $n*41]] -t $x $y} 640} 640

Tcl/Tk, 325
331 333 345 357 358 360 361 362 364 365
I think I would win if the criterium was beauty!
rename set s
grid [canvas .c -w 640 -he 640]
.c cr i 320 320 -i [s p [image c photo -w 640 -h 640]]
time {incr x
s y 0
time {incr y
s a 0
s b 0
s n 0
while \$n<99 {s A [expr $a*$a-$b*$b+$x[s f *4/639.-2]]
if [s b [expr 2*$a*$b+$y$f]]*$b+[s a $A]*$a>4 break
incr n}
$p p [format #%06x [expr $n*16777215/99]] -t $x $y} 640} 640

Presentation:

Nice. You can reduce a few characters (down to 380, I think) by adding rename set s at the top and then replacing all the set by s

Python 3, 290 Bytes
from PIL import Image
import numpy as n
s=640;d=n.zeros((s,s,3),dtype=n.uint8)
for k in range(s*s):
    r=4/s*(k%s)-2;i=2-4/s*(k//s);z=c=complex(r,i)
    for i in range(50,9950,100):
        if abs(z)>2:
            d[k//s,k%s]=[i*5,i*9,i*7];break
        z=z*z+c
Image.fromarray(d).show()

GLSL, 146 bytes
void mainImage( out vec4 o, vec2 C ) {o -= o; vec2 z;
for(;o.z++<99.^^length(z)>2.;)z=mat2(z.rg,-z.g,z)*z+C/99.-2.;o=mod(vec4(o.z)/vec4(4,2,6,0),1.19);}

https://www.shadertoy.com/view/sly3RW

no unique color for you

For some reason I see 95% animated noise and 5% Mandelbrot

Changing the final statement to o=vec4(mod(o.z/2.,2.),mod(o.z,2.),mod(o.z/4.,2.),0) might make it colorful (my theory at least)

You're right :) Thanks, updated it to fit the rules now. But +25 bytes

Julia
Well, better late than never:
function mandelbrot(x0,y0,side,N=800,L=55,R=3.)
    m = [0 for i=1:N,j=1:N]
    delta = side/N
    for i=1:N, j=1:N
        c = x0+delta*i+(y0+delta*j)*im
        z, h = 0+0*im, 0
        while (h<L) && (abs(z)<R)
            z = z^2+c
            h+=1
        end
        m[j,i]=h
    end
    return m
end
n=2.6
m = mandelbrot(-n/1.3,-n/2, n)
using Winston, Color
imagesc(m)
title("Mandelbrot Set")

Colormap Mod. :
function RGB_cm()
    colormap = [RGB(0,0,0) for t=1:255*5]
    rgb = [255,0,0]
    for t in 0:(255*5-1)
    c = [0, 0, 0]
    i = ifloor(t/255)
    c[(i+3)%3!=0?(i+3)%3:3] = (-1)^i
    rgb+=c
    colormap[t+1] = RGB(rgb[1],rgb[2],rgb[3])
    end
    colormap[(end-25):end] = RGB(0,0,0)
    return colormap
end
c = RGB_cm()
Winston.colormap(c)

Output:

Should I byte-count only the first program or both?

I think both, because without the color map mod the image would not satisfy the rules.

I'm sure you can save much on whitespace.

SmileBASIC, 126 bytes
X=RNDF()*4-2Y=RNDF()*4-2@N
N=N+16I=X+S*S-T*T
T=Y+S*T*2S=I
IF N<#L&&S*S+T*T<4GOTO@N
GPSET X*50+99,Y*50+99,RGB(99XOR N,N,N)EXEC.

Nice use of randoms to save on loops

Should make it 240x240, but I guess that would be longer.

Code golf is about what you can get away with, not what you should do.

JavaScript (pixel shader), 88 bytes
m=(x,y,A=0,B=0,n=99)=>n--&&A*A+B*B<4?m(x,y,A*A-B*B+x,2*A*B+y,n):`hsl(${n*7} 99%${n/2}%)`

A pixel shader function that takes x and y between [-2, -2] and [2, 2] and returns CSS <color> (HSL).

m=(x,y,A=0,B=0,n=99)=>n--&&A*A+B*B<4?m(x,y,A*A-B*B+x,2*A*B+y,n):`hsl(${n*7} 99%${n/2}%)`

const size = 512;
const scale = 4;
const ratio = scale / size;

const canvas = document.getElementById('canvas');
canvas.width = canvas.height = size;
const ctx = canvas.getContext('2d');

let x, y;
for (x = 0; x < size; x++) for (y = 0; y < size; y++) {
  ctx.fillStyle = m((x - size / 2) * ratio, (y - size / 2) * ratio);
  ctx.fillRect(x, y, 1, 1);
}
<canvas id="canvas"/>

Ungolfed and Explained
m = (
  x,    // Re(c)
  y,    // Im(c)
  A=0,  // Re(z[i])
  B=0,  // Im(z[i])
  n=99  // 99 - i
) =>
  n-- && // if haven't reached max depth
  A * A + B * B < 4 ? // and |z| < 2
    m( // recurse
      x,
      y,
      A * A - B * B + x, // Re(z[i] ^ 2 + c)
      2 * A * B + y,     // Im(z[i] ^ 2 + c)
      n
    ) : // else return HSL colour
    `hsl(${n * 7} 99% ${n / 2}%)` // n * 7 always unique in mod 360

all_licenses: 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/


text:
Worst Abuse of CSS?
What is some of the coolest/best/worse abuses of CSS?
For example, these shapes, or using multiple box-shadows to make pixel art.
popularity-contest ending on 16/04/14.

Using it inline in style attributes and adding !important to each one.

How do you define an abuse? I'm off-topic but thanks for the link with inspiring shapes.

@n.1 Something that was clearly not intended when the specifications were made.

This question doesn't comply with the rules.

The Internet...

You should accept some answer :)

@user80551: Post as an answer, I'd vote for that :D

Some dude created a tool to convert any image to pure CSS. This goes well beyond the original intent of CSS.
Here is an example (The famous Mona Lisa):
http://codepen.io/jaysalvat/pen/HaqBf
And here is the tool :
https://github.com/jaysalvat/image2css

Holy virgin mother of god! That is quite a great tool when you make a gradient background and you (for some reason) don't have the code near you and you need it.

Changing images on the fly
I won't necessarily call it abuse, but you can use CSS to replace an IMG with a given SRC to show a completely different image.
@media print
{
    IMG
    {
        padding: 150px 200px 0px 0px;
        background: url('lady.jpg');
        background-size:auto;
        width:0px; height: 0px;
    }
}

See: https://stackoverflow.com/questions/2182716/how-can-we-specify-src-attribute-of-img-tag-in-css
Can be lots of fun combined with @media selectors to display completely different images when printing a webpage. (Same trick can be done in PDF btw. Nice to see the face of the guy that is printing a document and all serious looking charts are replaced by beautiful ladies :))

+1 For cruel but ingenious ways of paying back on colleagues... Not that I would do it of course...

best use i've seen with img{background-image} was embedding an animated gif with a jpg background

Resizable elements:
You can add resize:both to allow an element to be resized by the user.
On some browsers, this is only supported on <textarea>'s.
Real-time CSS preview:
This is not an actual css thing, but you can add the contenteditable property, add the property style="display:block;z-index:99;width:500px;height:500px;resizable:both;" and you can edit your CSS.
Styled CSS Checkboxes/radiobuttons:
Using the following piece of markup as example:
<input type="checkbox" id="check_all" name="check_all" value="1">
<label for="check_all">Check all</label>

You can use display:none on the <input> and, using CSS3 selectors, you can set a 'sprite' background to show the different states of the checkbox/radiobutton.
The order of the elements is important, and matching the for="" property with the id="" in the input is even more important!
You can see some examples here: http://www.csscheckbox.com/
Browser specific selectors:
We all have tried to use some sort of javascript mix with css classes and media-queries...
Well, here are a few browser specific selectors:
doesnotexist:-o-prefocus, #selector {}/*opera only*/
:root {}/*target all css3 browsers*/
:-moz-any(*){}/*mozilla and mozilla based only*/
:-webkit-any(*){}/*webkit only*/

For IE, you have tons of selectors. No need for more.

I guess it depends what you mean by abuse but this would drive your users batty:
Jitters
*:hover{
  zoom:99%;
}

(as you mouse around the page everything jitters on you)
Experts-Exchange/Pay-To-View Effect
*{
  color:transparent;
  text-shadow:0 0 5px rgba(0,0,0,0.5);
}

(makes all the text blurry)
"Animated GIF's" using CSS sprite sheets
http://jsfiddle.net/simurai/CGmCe/light/
(Java's "The Dude" waving his hand)


text:
Eiffel Tower in 3D
This challenge asks you to draw the Eiffel Tower in 3D using different ASCII characters to represent the different sides, similar to this cube:
      @@@
   @@@@@@@@@
@@@@@@@@@@@@@@@
x@@@@@@@@@@@@&&
xxx@@@@@@@@&&&&
xxxxx@@@&&&&&&&
xxxxxx&&&&&&&&&
 xxxxx&&&&&&&
   xxx&&&&
     x&&

Here is a picture of the Eiffel Tower for you to base your art on:

Your program will input a rotational angle of the side view, then print the Tower as if you were looking at it from that angle.  The up/down angle does not need to be accounted for.
Score will be calculated as 1.25*votes - 0.25*length as a code-challenge.  Highest score wins.

Accounting for the view angle is going to be a vexing/fun challenge.

BBC BASIC, 66 chars
Emulator at bbcbasic.co.uk
A=PI/6FORJ=0TO83PRINTTAB(9+EXP(J/40)*SIN(A+J*PI/2),J/4);J MOD4:NEXT

With white space for clarity:
A=PI/6
FOR J=0 TO 83
  PRINT TAB(9+EXP(J/40)*SIN(A+J*PI/2),J/4);J MOD4
NEXT

Input is hard coded in radians. Taking user input would add one character, but user would have to input in radians. Removing the MOD4 from the end would still produce a recognisable tower, but might violate the rule regarding character per side.
Basically plots a string of zeros at exp(J/40)*sin(A) vs J/4. Additional values of the sin are added for the remaining three legs.

I hesitated to post this as I thought it was perhaps a little lazy. Then I saw the "500km away" answer and thought, why not!

Not bad, a lot better than "500km away" answer.  At least you can tell what it is!

Looks more like a rocket.

PHP, 364 * 0.25 = 91
Accepts a viewing angle as a query string parameter of the form ?a=0, ?a=45, ?a=90, etc.
<pre><?php
$a=45*floor(.5+intval(@$_GET['a'])/45);
$e=array(array(".","|","==","X|","X|","X/","==|","^||","-./","__//","=====","^^-. /","   |__|"),
array(".","|","==","X|","X|","X/","|=|","|^|","|./"," ///",":====",":|-. /","_|  |_|"));
echo "Angle: {$a}°\n\n";
foreach($e[$a&1] as $s){$p=str_pad($s,7);echo strrev($p).substr(strtr($p,'/','\\'),1)."\n";} ?>
</pre>

Examples:
a=135
Angle: 135°

      .
      |
     ===
     |X|
     |X|
     /X\
    |=|=|
    |^|^|
    /.|.\
   /// \\\
  ====:====
 / .-|:|-. \
|_|  |_|  |_|

a=200 (rounded to nearest increment = 180°)
Angle: 180°

      .
      |
     ===
     |X|
     |X|
     /X\
    |===|
    ||^||
    /.-.\
   //___\\
  =========
 / .-^^^-. \
|__|     |__|

(Yes I know, the angular resolution isn't brilliant. I'll improve on that if I have time.)

C# - 64 bytes
namespace System{class m{static void h(){Console.Write(".");}}}

Prints the Eiffel Tower viewed from 500 26.5 kilometers away.
Takes the rotational angle as an argument.
Example usage:
eiffel.exe 90

EDIT
I've made an approximation, and it should be about 26.5 kilometers away.
Let's consider the image below, taken from OP and edited to add a "." using the font Monospace 12 without anti-aliasing.

The "." is 2 pixels long and 1 pixels wide whereas the tower is 400 pixels long and 663 pixels wide(approximately).
Let's assume the tower is viewed from 100 meters away.
If we want to make it look like a 2x1 box, we would need to make it (again, approximately) 265.5 times smaller(200 times smaller for the height and 531 times smaller for the width).
If we multiply 265.5 with 100 meters, we get 26550 meters, which is 26.5 kilometers.

There's a bug in your code.  The output should be " " when viewed from 500km.

This is not funny.

@Comintern Actually no, it would be smaller than a . but bigger than an empty space.

@user3188175 It depends on OP monitor I guess

I'm less than 500km from the Eiffel Tower, but there's not a single pixel in view here :-D

@squeamishossifrage Think of it as a view from space. Or even, assume it's in space.


text:
Let's create random number genrator
The task is to make a function which returns random number, no build in functions allowed, returned value should be random or pseudo-random and no sequence allowed, no matter what the formula is and how scattered values are.
To simplify task, returned value should be 32-bit integer or float from range [0; 1)
It is code golf, shortest code wins :)

CoffeeScript (16 bytes)
->new Date%2**32

This is awful random number generator, but if you wait enough, you can get any integer.