text:
Replace letters by their rank, keeping punctuation intact
The problem is simple. Given a string such as Hello World! the program would output 8-5-12-12-15 23-15-18-12-4-!. Any delimiters will do, (please specify what they are though) I just chose to use space between words and dashes between characters.
The conversion is that all alphabetical characters will be converted to their numeric equivalent. i.e. A=1,B=2,...,Z=26. All other characters must be kept intact. Case insensitive.
Another example
Here's another example, I hope that this will illustrate my point! If it's unable, more specs will be given.
8-5-18-5-'-19 1-14-15-20-8-5-18 5-24-1-13-16-12-5-, 9 8-15-16-5 20-8-1-20 20-8-9-19 23-9-12-12 9-12-12-21-19-20-18-1-20-5 13-25 16-15-9-14-20-! 9-6 9-20-'-19 21-14-1-2-12-5-, 13-15-18-5 19-16-5-3-19 23-9-12-12 2-5 7-9-22-5-14-.

Note that there are no trailing or starting delimiters between characters.
Scoring will be based on the shortest amount of code. Any language is welcome.
As long as more answers are provided I will change the winner.
GLHF!

One test case does not constitute a specification.

@JanDvorak that would be acceptable as well. Just indicate which delimiters are being used.

What is an "alphabetical character"? Just A-Za-z with no accents? And is this really [tag:cryptography]?

@PeterTaylor alphabetical character is A-Za-z, case insensitive. It's a basic cypher.

@Taka it's not an encryption. It's an encoding. Lossy encoding, and inefficient.

Maybe encoding rather than cipher. [edit, Jan beat me to it]

@JanDvorak ok, should I change the tags?

@Taka yep. 'tis ain't cryptography any more than base64 is.

Where should the separators be inserted? From the examples seems that separators should occur between codes and other characters except space. So “a c/dc” becomes “1 3-/-4-2”? So space is the only exception?

@manatwork yes, that seems to be the case. Sorry I didn't mention that.

I think you accepted an answer too early. Others haven't had a chance to give it a shot.

@arshajii I said that as long as more answers are provided I'll change who the winner is. Is that the wrong way to do it? If so what should I do?

The examples may still not be enough comprehensive. As I understand, “abc_123” has to become “1-2-3-_-1-2-3”, right?

The disagreement in the comments on my answer also indicate that the spec is still ambiguous.

@mantawork yes that is right.

Furthermore, I would have been restricted the delimiters to single characters. Using “- -” as word separator currently complies with the rules, but voids the one clarified in your earlier comment.

GolfScript (24 22 chars)
{.32|96^:@`]@(26/!=n}%

is a hybrid of Howard's solution and my previous one:
{.223&65-.26/!{)`\}*;n}%

Since the spec states that I can use any delimiter, I've chosen to use newline.
Online demo

Nice abuse of the delimiter rule!

I'd like to upvote your solution - but you don't have a word delimiter, do you?

@Howard, I don't have a different word delimiter, but the spec is so vague that it doesn't seem to require one.

@PeterTaylor It does. Take e.g. "Hello\nworld" as input and you'll end up with three delimiters between words instead of one. (btw. my solution reduces to 23 chars if I'd take the same approach ;-) )

@Howard if you put a delimiter in the input to any of the programs it would look like it was more. Unless we want to clear for those, which isn't specified. This keeps it intact, technically.

Ruby 2.0, 41+1 characters
There, now it complies with the updated rules and makes prettier output.
gsub(/\w+/){$&.chars.map{|c|c.ord&31}*?-}

Run with -p switch:
ruby -p ord.rb <<< "ABC! Defghi, jklmnopqr stuvwxyz"
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

Nice one. But seems there should be no dashes around the spaces.

@manatwork it was submitted before I cleared that up. So it's cool, and is quite good.

@manatwork, @taka; fixed it anyways :)

@daniero do you know how to run this online? Also wish I could upvote this.

Nice answer. I think you can do c.ord&31 and save 5 characters ;)

@Taka no, unfortunately I haven't found an online resource which supports the correct version of Ruby and lets you run it with the -p option.

Even greater. But still a glitch: now there are no separators neither around the unencoded characters.

@manatwork Yes I know. And actually I like it. The problem is not that accurately described, and the encoding is lossy no matter what, so I'll cut myself some slack; The key problem to be solved in the question is translating alphabetic characters to numbers, which the program does.

@daniero, I somehow agree. (You got my upvote anyway.) I was just curious whether more spectacular twists can be condensed in that code. (My first unposted try was also in ruby. About double of your code…)

@manatwork Thank you. Yes, I think separating and dealing with the non-alpha characters more precisely takes way more code. In codegolf I prefer shorter code and less accurate output; Dealing with special cases is not the golfing way. I first tried some more complicated stuff, but this bug and some other weird behavior made me call it off.

Perl: 42 38 characters
s/\S(?=\S)/$&-/g;s/[a-z]/31&ord$&/ige

Sample run:
bash-4.1$ perl -pe 's/\S(?=\S)/$&-/g;s/[a-z]/31&ord$&/ige' <<< "Here's another example, I hope that this will illustrate my point! If it's unable, more specs will be given."
8-5-18-5-'-19 1-14-15-20-8-5-18 5-24-1-13-16-12-5-, 9 8-15-16-5 20-8-1-20 20-8-9-19 23-9-12-12 9-12-12-21-19-20-18-1-20-5 13-25 16-15-9-14-20-! 9-6 9-20-'-19 21-14-1-2-12-5-, 13-15-18-5 19-16-5-3-19 23-9-12-12 2-5 7-9-22-5-14-.

You can shorten the replacement part of the second substitution to 31&ord$&.

In the second substitution, [a-z] may be replaced by \pL, making the i flag unnecessary.

Thank you, @primo. Unicode character properties somehow didn't made their way into my regular expressions. As “alphabetical character is A-Za-z”, this will somehow violate the rules. But will keep it in mind and use it if the other answers will have more relaxed attitude on respecting the rules.

GolfScript, 37 36 23 characters
The following version takes newline as delimiter (as Peter's solution):
{.32|96^:@`]@27,?0>=n}%

A version which interprets words and delimiters as in the examples given is 36 characters long:
' '/{'-'*{.32|96^:@`]@27,?0>=}%' '}%

(Strange enough my first version '-''- -'/' '{.32|96^:@`@0>@27<&if}% didn't work...)
Takes input on STDIN. The example can be tested online:
> 'Hello world!'
8-5-12-12-15 23-15-18-12-4-!

Could you show how to run it. Using golf online

R - 134 characters
A bit too long to be really in competition but here we go:
s=sapply
l=letters
cat(s(strsplit(scan(,""),""),function(x)paste(s(tolower(x),function(y)ifelse(y%in%l,which(l==y),y)),collapse="-")))

Word delimiter is space, character delimiter is -.

Tcl, 82
lmap a [split [string tol $i] {}] {expr {[string is alpha $a]?[scan $a %c]-96:$a}}

Because you did not specify what you want, well, here an expression.
Input in i, result of the expression is the result.
Example:
% set i "Hello World!"
Hello World!
% lmap a [split [string tol $i] {}] {expr {[string is alpha $a]?[scan $a %c]-96:$a}}
8 5 12 12 15 { } 23 15 18 12 4 !

Word delimiter is { }, character delimiter is

Python - 47 63
This assumes you've assigned the string to the variable s.
47 uses a flagrant abuse of the rules and says that [ is the delimiter for the start of the original string, ] marks the end of the original string, , marks the different characters and unchanged characters are captured in quotes.
str([(x,ord(x)-64)[x.isalpha()] for x in s.upper()])

Alternatively, 62 squeezes a line from below (although 'A'<=x<='Z' is just as long and works just as well.:
'-'.join([str((x,ord(x)-64)[x.isalpha()]) for x in s.upper()])

63:
'-'.join([str((x,ord(x)-64)[64<ord(x)<91]) for x in s.upper()])

And the sample output:
>>> s = "Hello World!"
>>> '-'.join([str((x,ord(x)-64)[64<ord(x)<91]) for x in s.upper()])
'8-5-12-12-15- -23-15-18-12-4-!'

I'm not sure I would consider these programs, as they don't read any input from stdin, nor do they write any output to stdout. A 52 byte program, abusing the newline delimeter as @PeterTaylor does: for x in raw_input():print(x,ord(x)&31)[x.isalpha()]

Javascript, 81 74
""+[].map.call(prompt(),function(c){a=c.charCodeAt(0);return a>65&&a<123?a&31:c})
With the input taken from a variable
""+[].map.call(s,function(c){a=c.charCodeAt(0);return a>65&&a<123?a&31:c})
Output from the string you chose

8,5,18,5,',19, ,1,14,15,20,8,5,18, ,5,24,1,13,16,12,5,,, ,9, ,8,15,16,5, ,20,8,1,20, ,20,8,9,19, ,23,9,12,12, ,9,12,12,21,19,20,18,1,20,5, ,13,25, ,16,15,9,14,20,!, ,9,6, ,9,20,',19, ,21,14,1,2,12,5,,, ,13,15,18,5, ,19,16,5,3,19, ,23,9,12,12, ,2,5, ,7,9,22,5,14,.

          |  Word  |  Char  |
Delimiters|  , ,   |    ,   |

“All other characters must be kept intact.” – You also encoded the punctuations.

@manatwork Oops, Thanks! i have missed that part, fixing it.

Mathematica 68
Commas used as separators.
If[64 < # < 97, # - 64, FromCharacterCode@#] & /@ ToCharacterCode@ToUpperCase@i

Example
i="To be, or not to be,--that is the question:-- Whether 'tis nobler in
the mind to suffer The slings and arrows of outrageous fortune Or to
take arms against a sea of troubles, And by opposing end them?";

If[64 < # < 97, # - 64, FromCharacterCode@#] & /@ ToCharacterCode@ToUpperCase@i

{20, 15, " ", 2, 5, ",", " ", 15, 18, " ", 14, 15, 20, " ", 20, 15, "
", 2, 5, ",", "-", "-", 20, 8, 1, 20, " ", 9, 19, " ", 20, 8, 5, " ",
17, 21, 5, 19, 20, 9, 15, 14, ":", "-", "-", " ", 23, 8, 5, 20, 8, 5,
18, " ", "'", 20, 9, 19, " ", 14, 15, 2, 12, 5, 18, " ", 9, 14, " ",
20, 8, 5, " ", 13, 9, 14, 4, " ", 20, 15, " ", 19, 21, 6, 6, 5, 18, "
", 20, 8, 5, " ", 19, 12, 9, 14, 7, 19, " ", 1, 14, 4, " ", 1, 18,
18, 15, 23, 19, " ", 15, 6, " ", 15, 21, 20, 18, 1, 7, 5, 15, 21, 19,
" ", 6, 15, 18, 20, 21, 14, 5, " ", 15, 18, " ", 20, 15, " ", 20, 1,
11, 5, " ", 1, 18, 13, 19, " ", 1, 7, 1, 9, 14, 19, 20, " ", 1, " ",
19, 5, 1, " ", 15, 6, " ", 20, 18, 15, 21, 2, 12, 5, 19, ",", " ", 1,
14, 4, " ", 2, 25, " ", 15, 16, 16, 15, 19, 9, 14, 7, " ", 5, 14, 4,
" ", 20, 8, 5, 13, "?"}

C# - 137 Characters
This code assumes the string to convert is the s variable
Regex.Replace(Regex.Replace(s.ToUpper(),@"[A-Z]",m=>(((int)m.Value[0])-64).ToString()+'-'),@"[^\w\s-]",m=>m.Value+'-').Replace("- "," ");

Jelly, 11 bytes
26R;`,@ØẠyK

Try it online!
Uses space as a delimiter.
How it works
26R;`,@ØẠyK - Main link. Takes a string s on the left
26R         - Yield [1, 2, ..., 26]
   ;`       - Concatenate it to itself; [1, 2, ..., 26, 1, 2, ..., 26]
       ØẠ   - Yield "ABC...XYZabc...xyz"
     ,@     - Pair; [["A", "B", ..., "Z", "a", ..., "z"], [1, 2, ..., 26, 1, ..., 26]]
         y  - Transliterate s according to the mapping above
          K - Join by spaces

Shouldn't the delimiter only be included after letters?

@Shaggy Judging from "I just chose to use space between words and dashes between characters." in the question, and from Peter Taylor's 7 year old answer, I think its acceptable to use the same delimiter between each of the characters

Ah, yes, I see how that could be abused now :)

Q, 53
{1_ssr[-3!(`$'x)^`$(.Q.a!($)1+(!)26)@(_)x;"``";"  "]}

Backtick Delimited
q){1_ssr[-3!(`$'x)^`$(.Q.a!($)1+(!)26)@(_)x;"``";"  "]}"Here's another example, I hope that this will illustrate my point! If it's unable, more specs will be given."
"8`5`18`5`'`19  1`14`15`20`8`5`18  5`24`1`13`16`12`5`,  9  8`15`16`5  20`8`1`20  20`8`9`19  23`9`12`12  9`12`12`21`19`20`18`1`20`5  13`25  16`15`9`14`20`!  9`6  9`20`'`19  21`14`1`2`12`5`,  13`15`18`5  19`16`5`3`19  23`9`12`12  2`5  7`9`22`5`14`."

Japt v2.0a0 -S, 10 bytes
¬®r\lÈc uH

Try it
¬®r\lÈc uH     :Implicit input of string
¬              :Split
 ®             :Map
  r            :  Replace
   \l          :  /[A-Z]/gi
     È         :  Pass each match through a function
      c        :    Character code
        u      :    Modulo
         H     :    32


text:
Build a multiplying machine using NAND logic gates
Based on my previous question of the same type, Build an adding machine using NAND logic gates, this time you're being asked to multiply instead of add.
Build a diagram of (two-wire) NAND logic gates that will take the input wires A1, A2, A4, B1, B2, B4, representing two binary numbers A to B from 0 to 7, and return values on the output wires C1, C2, C4, C8, C16, and C32, representing C, which is the product of A and B.
Your score is determined by the number of NAND gates you use (1 point per gate). To simplify things, you may use AND, OR, NOT, and XOR gates in your diagram, with the following corresponding scores:

NOT: 1
AND: 2
OR: 3
XOR: 4

Each of these scores corresponds to the number of NAND gates that it takes to construct the corresponding gate.
Lowest score wins.

I'm trying to make a last-place example in Logisim. This stuff is hard.

I got enough of this stuff in my school, no thanks.

I have a universal optimizer for tasks like this.  It provably finds the shortest program to compute a k-output boolean function.  If I gave it a week, it could tell me if the 13 gate 2x2 multiplier it found is optimal.  3x3?  I'll be dead before it finishes.

That 13 gate 2x2 multiplier is optimal (and contained in Jan's answer).  With that, and another few pieces I can optimize, I very strongly suspect 60 to be optimal for this problem.  I really hope somebody proves me wrong.

@boothby Not really. Naive application of adder trees leads to an 18-gate solution (4 ANDs, 2 half-adders), which leads me to an idea: I should be able to steal^k^k^k^k^k utilise the 13-gate 2x2 multiplier.

can I get a clock input, please? Maybe a shift-accumulate approach would lead to a smaller solution

@boothby it turns out I can utilise a 13-gate 2x2 multiplier

Looks like I mistraced some lines in your original, and it looked like a 2x2 only took 13.  It's funny how just knowing the number of operations to shoot for makes it possible to find.  I just installed the latest lingeling, and I think I can now optimize the 3x2.

Just to explain the bump: Someone posted here as an answer a claim that he has a 39-gate solution available. He didn't post the solution, but I'm still curious if 39 gates is actually possible.

39 gates
I am quite sure there are no simpler designs than mine here.
It was very difficult to make. I make other minimal circuits too.
Transmission delay is indicated by downward position of each NAND gate on the sheet.

Verilog code and testing:
// MINIMAL 3 BIT MULTIPLICATOR
//
// The simplest 3 bit multiplicator possible, using 39 NAND gates only.
//
// I have also made multiplicators that are faster, more efficient,
// use different gates, and multiply bigger numbers. And I also do
// hard optimization of other circuits. You may contact me at
// kim.oyhus@gmail.com
//
// This is my entry to win this hard Programming Puzzle & Code Golf
// at Stack Exchange:
// https://codegolf.stackexchange.com/questions/12261/build-a-multiplying-machine-using-nand-logic-gates/
//
// By Kim Øyhus 2018 (c) into (CC BY-SA 3.0)
// This work is licensed under the Creative Commons Attribution 3.0
// Unported License. To view a copy of this license, visit
// https://creativecommons.org/licenses/by-sa/3.0/

module mul3x3 ( in_000, in_001, in_002, in_003, in_004, in_005, out000, out001, out002, out003, out004, out005 );
  input  in_000, in_001, in_002, in_003, in_004, in_005;
  output out000, out001, out002, out003, out004, out005;
  wire   wir000, wir001, wir002, wir003, wir004, wir005, wir006, wir007, wir008, wir009, wir010, wir011, wir012, wir013, wir014, wir015, wir016, wir017, wir018, wir019, wir020, wir021, wir022, wir023, wir024, wir025, wir026, wir027, wir028, wir029, wir030, wir031, wir032;

  nand gate000 ( wir000, in_000, in_005 );
  nand gate001 ( wir001, in_000, in_004 );
  nand gate002 ( wir002, in_000, in_003 );
  nand gate003 ( out000, wir002, wir002 );
  nand gate004 ( wir003, in_004, in_001 );
  nand gate005 ( wir004, wir003, wir003 );
  nand gate006 ( wir005, in_003, in_002 );
  nand gate007 ( wir006, wir000, wir005 );
  nand gate008 ( wir007, in_004, in_002 );
  nand gate009 ( wir008, in_001, in_005 );
  nand gate010 ( wir009, wir008, wir007 );
  nand gate011 ( wir010, in_001, in_003 );
  nand gate012 ( wir011, wir001, wir010 );
  nand gate013 ( wir012, out000, wir004 );
  nand gate014 ( wir013, wir004, wir012 );
  nand gate015 ( wir014, wir011, wir012 );
  nand gate016 ( out001, wir014, wir014 );
  nand gate017 ( wir015, in_002, in_005 );
  nand gate018 ( wir016, wir015, wir015 );
  nand gate019 ( wir017, out000, wir016 );
  nand gate020 ( wir018, wir017, wir013 );
  nand gate021 ( wir019, wir016, wir018 );
  nand gate022 ( wir020, wir019, wir009 );
  nand gate023 ( wir021, wir020, wir017 );
  nand gate024 ( wir022, wir020, wir009 );
  nand gate025 ( wir023, wir022, wir021 );
  nand gate026 ( out005, wir022, wir022 );
  nand gate027 ( wir024, wir016, wir022 );
  nand gate028 ( wir025, wir006, wir018 );
  nand gate029 ( wir026, wir025, wir006 );
  nand gate030 ( wir027, wir025, wir018 );
  nand gate031 ( out002, wir026, wir027 );
  nand gate032 ( wir028, wir004, wir027 );
  nand gate033 ( wir029, wir023, wir028 );
  nand gate034 ( wir030, wir028, wir028 );
  nand gate035 ( wir031, wir030, wir021 );
  nand gate036 ( out004, wir031, wir024 );
  nand gate037 ( wir032, wir029, wir031 );
  nand gate038 ( out003, wir032, wir032 );
endmodule

module mul3x3_test;
   reg  [5:0] AB; // C=A*B
   wire [5:0] C;

  mul3x3 U1 (
  .in_000 (AB[0]),
  .in_001 (AB[1]),
  .in_002 (AB[2]),
  .in_003 (AB[3]),
  .in_004 (AB[4]),
  .in_005 (AB[5]),
  .out000 (C[0]),
  .out001 (C[1]),
  .out002 (C[2]),
  .out003 (C[3]),
  .out004 (C[4]),
  .out005 (C[5])
  );

  initial  AB=0;
  always  #10  AB = AB+1;
  initial  begin
    $display("\t\ttime,\tA,\tB,\tC");
    $monitor("%d,\t%b\t%b\t%b",$time, AB[5:3], AB[2:0],C);
  end
  initial  #630  $finish;
endmodule

// iverilog -o mul3x3_test mul3x3_test.v
// vvp mul3x3_test

Kim Øyhus

Do you have a proof that your answer is valid?

I would recommend diagramming this in Logisim (it's free), so that it can easily be seen and tested.

It is too big to be proved as minimal, except perhaps by a future quantum computer. So I use statistical methods to verify its optimality. It still takes an excessive amount of computing time.

Jonathon asked for a proof of validity, rather than a proof of optimality. I don't think you need to prove it valid. But it would be nice if it were easier for us to test whether this is valid, rather than taking your word for it

This does work: try it online!

It's not necessary, but it would be great to hear how you came up with this

If you're still intending to license this commercially, it's worth getting advice on whether the copyright declaration overrides Stack Exchange's default licensing of user contributions (see the link at the bottom of every page). It says CC-BY-SA 3.0, which explicitly gives everyone the right to use the content, "for any purpose, even commercially"

I should consider that, yes. But at the moment I am just too busy. And solutions to other puzzles coming along. I can change that copyright later if necessary.
As for commercialisations, I have other designs for that, optimised for more realistic gates and needs.

60 55 50 48 gates

The original (60 gates) was the systematic approach - multiply each digit with each, and then sum them together. Namely, see Wallace trees and Dadda trees

The top half is the multiplication network - multiply each digit with each, and group output digits with the same weight. Some bits have been left inverted to save gates.
The second half is the adder network. Each box represents a single adder - either a half-adder (5 gates - 1x XOR and an inverter), or a full adder (9 gates - 2x XOR and NAND the inverted carry bits). The top are inputs, the bottom output is the sum, the left output is the carry-out.  see the previous challenge
The 2x2 multiplier has then been hand-optimised to a custom-built 13-gate network, which is the optimal size as found by @boothby. Thanks!
Pasting it into the low-bit corner and reoptimising the adder tree saves five gates (see revision #2). Pasting it into the high-bit corner as well, however, produces overlap. A little bit of math tells us, however, that dropping the low-bit of the high multiplier solves the overlap and what's left to do is to add the remaining two bits and sum up stuff.
This alone, unfortunately, does not provide any savings, but it does open two optimisations. First, the two multipliers have two gates in common, and can be fused together. At this point, we're back at 55. Second, in the addition network, we don't need a half-adder because we know its carry will be zero. We can replace it with an OR. An OR is a NAND with its inputs inverted. This produces us with two 2-chains of NOTs on each branch, which can then be removed, for a total saving of five gates. Unfortunately, the half-adder at C16 still carries, so we cannot do the same there. Third, a full adder has a useful property: if you invert its inputs and its outputs, it still behaves the same. Since all its inputs are already inverted, we can just as well move the inverters behind it. Twice. We could have done the same in the original, but... oh well. We still have a half-adder with two inverted inputs. I want optimise this part more, but I doubt I can.
Since we're pulling out a NOT from inside a component, we have to signify that somehow. We have obtained a half-adder with inverted carry (AKA tapped XOR) at a cost of four gates.
In the meantime, we have also redrawn the diagram significantly.

The only part which looks potentially optimisable is the middle block of adders. The logical requirement is for a superfull-adder (takes 4 input bits, has two carry output bits) and a full adder; your implementation with two full-adders and two half-adders looks hard to improve.

I tried to make this exact network last night, but I'm not well-versed enough in logical networks, it seems.

Most excellent!

source: Stack Exchange

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

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

sort: votes


text:
Make FizzBuzz using only preprocessor directives
I have a source file here:
#include <FizzBuzz.h>
fizzbuzz

And I want to make "fizzbuzz" turn into a FizzBuzz program solely through the preprocessor.
Your task is to write a FizzBuzz.h that uses only preprocessor directives (things like include, define, etc.) to create a working FizzBuzz program. Specifically, I want to see the use of macros, which will be required to make this work (at minimum, defining fizzbuzz to be some code).
However, to make sure people try and take full advantage of the power of macros, your score will be defined as the sum of the cubes of the length of the definition portion (the part after #define <symbol>) of each macro.
So, for example, the following file:
#define A 123
#define B A+A
#define C B*2+A

would have a total score of 179 (3^3 + 3^3 + 5^3). As a rule, I want multiple shorter lines instead of one long line.

Do you have any reason to believe that the answers won't all define one of the tokens to an empty string and the other to a one-line program? (Or in other words, what distinguishes this from a boring "golf fizzbuzz"?)

I thought of that myself. I'll probably reupload it with new restrictions.

Added a new scoring algorithm that should favour multiple short lines.

Can you give an exact specification of FizzBuzz? I guess we all know the idea, but do you want a function that gets a single number, or a loop (until when?) or what?

The same specification as here: http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html

You need an algorithm to favor lines of code, too? How about The sum of the cubes of each definition multiplied by the number of lines in fizzbuzz.h, excluding empty lines and empty definitions.? Your example would become (3^3 + 3^3 + 5^3) * 3 for a total score of 537.

C, Score 1,283 1,213 1,205
EDIT: Instead of basing on Loki Astari's solution, now I'm based on breadbox's
The basic code is not exactly the same as breadbox's - I replaced the loop with recursion, which is longer, but has more repetition.
With GCC, it can be improved further, by using ?: instead of ?0:.
#define A "Fi"
#define D "Bu"
#define E "z"
#define L E E
#define F L,z
#define R F)
#define G A R
#define H D R
#define I ""
#define K "%d"
#define X printf
#define Y puts
#define Z main
#define M 99
#define N z%5
#define O z%3
#define P Z(z
#define Q P)
#define a Q{X
#define b a(O
#define c b?N
#define d c?K
#define e d:I
#define f e:G
#define i f;Y
#define j i(N
#define k j?I
#define l k:H
#define n l;z
#define o n++
#define p o>M
#define q p?0
#define r q:Q
#define s r;
#define fizzbuzz s}

Macro-free code:
main(z){printf(z%3?z%5?"%d":"":"Fizz",z);puts(z%5?"":"Buzz",z);z++>99?0:main(z);}

The 2nd parameter to puts does nothing. It allows me to utilize the zz",z) sequence.

It's a crime that this answer is the currently the lowest rated.

@breadbox, A late answer to an unpopular question - what can you do? And it doesn't contain much new compared to other.

C score 1602 1592 1535 1515 1505 1451
#include <stdio.h>
#define A       "%d"
#define B       "Bu"
#define C       "Fi"
#define w       "z"
#define D       w w
#define E       "\n"
#define F       main
#define G       printf
#define I       for
#define J       99
#define L       c++
#define O       A E
#define P       O:B
#define Q       P D
#define R       Q E
#define S       c%3
#define T       c%5
#define U       S?T
#define V       U?R
#define W       V:T
#define X       W?C
#define Y       X D
#define Z       Y E
#define a       Z:C
#define b       a D
#define d       b B
#define e       d D
#define f       e E
#define g       f,c
#define r       (g)
#define h       G r
#define i       ;L
#define j       J;h
#define k       i<=
#define l       k j
#define q       (l)
#define m       I q
#define n       m;
#define o       {n}
#define p       F()
#define s       c;p
#define fizzbuzz s o

Original source:
c;main(){for(;c++<=99;printf(c%3?c%5?"%d\n":"Buzz\n":c%5?"Fizz\n":"FizzBuzz\n",c));}

Now I am wondering if we change the code too:
c;main(){for(;c++<=99;printf(6*(c%3<1)+12*(c%5<1)+"%d  \n\0Buzz\n\0Fizz\n\0FizzBuzz\n\0",c));}

It looks longer. But more compressable using macros.

Doesn't work... c is uninitialized. Can be fixed at no cost by making c global. Even better - remove int. Even better - make it a parameter (but then it starts with 1).

@ugoren:Fixed :-)

You can also split some 3-char macros to 2*2. E.g. (g) -> (x + g).

With a bit more effort it goes below 1400.

You have 3 and 5 the wrong way round in your single-string solution. It might also be worth indexing "Buzz\n\0" as "FizzBuzz\n\0"+4.

@PeterTaylor, If the contributions of c%3 and c%5 to the pointer are additive, as in Loki's code, it won't work. But it's easily done using nested ?:.

@ugoren, I tested it with 4*(c%3<1^c%5<1)+10*(c%5<1)+"%d\n\0Fizz\n\0FizzBuzz\n\0", although looking at it now that final \0 is unnecessary.

(I also considered how to exploit the fact that c*c*c*c%15 takes precisely 4 values in perfect correlation with the desired format string*, but I suspect that the expression gets too complicated). *For generalised FizzBuzz with primes p and q, c^lcm(p-1, q-1) mod pq distinguishes suitably.

@PeterTaylor, "Fizz\n\0------Buzz\n\0--%d\n\0FizzBuzz\n"+24-i*i*i*i%15%7*4 works. Any good?

@PeterTaylor: The final '\0' is not there to terminate the string. It is there so that we have 4 common sub strings of '\n\0' that can be represented by a single macro. Was hoping that would make it easier to compress.

You'd express that with two macros, though, because len("\n")^3 + len("\0")^3 = 128 < 216 = len("\n\0")^3 so the macro for just a newline would be around anyway.

@PeterTaylor: Yes agreed. But it gives opportunities for other compressions as 'Buzz\n\0' is repeated twice. Looking at in isolation is not going to help, you have to look at the big picture. Anyway it may not have worked it was just something I was thinking about.

@LokiAstari, I have a solution with score 1,283. It copies your source exactly (except changing <= to +~) and your macro methods, so I can't publish it as my own. I hope you have the time to push your solution there.

@ugoren: Of course you can. Just add it.

C, score 1267
Best I could do:
#define a main
#define b for
#define c puts
#define d printf
#define e ""
#define f x Z
#define g y Z
#define h "%d"
#define x "Bu"
#define y "Fi"
#define z "z"
#define Z z z
#define A 101
#define B i++
#define C B%5
#define D C?e
#define E D:f
#define F i%3
#define G F?i
#define H G%5
#define I H?h
#define J I:e
#define K J:g
#define L K,i
#define M i<A
#define N M;c
#define O a(i
#define P N(E
#define Q d(L
#define R O)
#define S b(
#define T P)
#define U Q)
#define V U;
#define W R{S
#define X W;T
#define Y X)V
#define fizzbuzz Y}

This is roughly the same approach that the other entries are using, looks like. I suspect the marginal improvement comes from the brevity of the target program. At 75 bytes, it's the shortest C fizzbuzz I know (that doesn't depend on compiler-specific behavior):
main(i){for(;i<101;puts(i++%5?"":"Buzz"))printf(i%3?i%5?"%d":"":"Fizz",i);}

Nice, but is i's initial value guaranteed?

i's initial value will be one if the user invokes the program without extra command-line arguments. The behavior will change if other parameters are given on the command line, but that's true of most every program.

C, Score 28,703 18,043 4,367
#define S(x) #x"\n"                     // 6
#define X(a) W?Y(a)                     // 6
#define W c%5                           // 3
#define Y(a) S(a):Z(a)                  // 9
#define Z(a) S(a##Buzz)                 // 10
#define fizzbuzz A%Q}                   // 4
#define A char*B                        // 6
#define B p,C                           // 3
#define C c;D(E                         // 5
#define D main                          // 4
#define E ){F                           // 3
#define F for(G                         // 5
#define G ;c++H                         // 5
#define H <=I(K                         // 5
#define I 99;J                          // 4
#define J printf                        // 6
#define K *p+L                          // 4
#define L ~9?M                          // 4
#define M p:N,O                         // 5
#define N S(%d)                         // 5
#define O c))P                          // 4
#define P p=c                           // 3
#define Q 3?R;                          // 4
#define R X():T                         // 5
#define T X(Fizz)                       // 7

Original macro-free program:
c,*p;
main(){
        for(;c++<=99;printf(*p+~9?p:"%d\n",c))
                p=c%3?c%5?"\n":"Buzz\n":c%5?"Fizz\n":"FizzBuzz\n";
}

This is the kind of solution I was looking for. :D

The same macro tricks that you like are what makes my solution longer than Loki Astari's - he uses C string concatenation instead of ##.

C++, Score 68,508
I know this does not meet the criteria (lots of really short macro definitions), but I think it has an advantage over the other answers. First the solution:
#include <iostream>
#define X(a) H(a,N)H(1,L)
#define W(a,b,c) H(U(a,b),c)H(a,M)
#define V J::
#define U(a,b) !(a)&&!(b)
#define T ==0
#define S K<<
#define R %5 T
#define Q main
#define P int
#define O %3 T
#define N "Buzz"
#define M "Fizz"
#define L V endl
#define K V cout
#define J std
#define I if
#define H(a,b) I(a)S(b);
#define G(a,b,c) W(a,b,c)X(b)
#define F(a) G((a)O,(a)R,a)
#define E(a,b,c,d) F(a*20+b*4+c*2+d+1)
#define D(a,b,c) E(a,b,c,0)E(a,b,c,1)
#define C(a,b) D(a,b,0)D(a,b,1)
#define B(a) C(a,0)C(a,1)C(a,2)C(a,3)C(a,4)
#define A B(0)B(1)B(2)B(3)B(4)
#define fizzbuzz P Q(){A}

Second, I think the advantage to this is that it truly uses the preprocessor to its "best" advantage. Namely, it does not use any looping constructs or variables in determining FizzBuzz. All parameters are constants, thus all the expressions can be compile time evaluated. Any if-condition that is false can be optimized away, so the final optimized form of the compiled program is really just a bunch of statements like cout << something; cout << endl.

C++, Score 24,806 (Revised from Earlier Answer)
I came across code I posted last September and decided to refine it. I was able to cut it down significantly (for a savings of 43,702 "points") while keeping in the spirit of my original submission (no variables, just pre-processed constants). Not that anyone cares, but hey, I was bored. :)
#include <iostream>
#define _ {A}
#define a ()
#define b main
#define c int
#define d a _
#define e c b
#define f "u"
#define g "B"
#define h "i"
#define i "F"
#define j "z"
#define k w v
#define l endl
#define m <<
#define n cout
#define o ::
#define p std
#define q g f
#define r i h
#define s j j
#define t N)O
#define u l;
#define v n m
#define w p o
#define y q s
#define z r s
#define Z(a,b) M(a)k b;
#define Y 0;
#define X return
#define W 100
#define V %5
#define U %3
#define T ==0
#define S w v w u
#define R(a) Z(a,y)
#define Q(a) Z(a,z)
#define P(a,b,c) Z(!(a)&&!(b),c)
#define O X Y
#define N >W
#define M if
#define L V T
#define K U T
#define J(a,b,c) P(a,b,c)Q(a)R(b)S
#define I(a) M(a t
#define H(a) I(a)J((a)K,(a)L,a)
#define G(a) H(a+1)H(a+2)
#define F(a) G(a)G(a+2)
#define E(a) F(a)F(a+4)
#define D(a) E(a)E(a+8)
#define C(a) D(a)D(a+16)
#define B(a) C(a)C(a+32)
#define A B(0)B(64)
#define fizzbuzz e d

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


text:
Sum of Products of Subsets
Given an integer k and a list of integers A of size n, find the product of all subsets in A of size k and sum them together.
For example,
k = 2
n = 4
A = 1 2 3 4

The subsets of size 2 and their products are
1 2 = 2
1 3 = 3
1 4 = 4
2 3 = 6
2 4 = 8
3 4 = 12

which sum together to 35.
Some test cases:
Input
A = 73 36 86 76 5 25 15 95 27 1
n = 10
k = 4

A = 7 16 56 83 14 97 71 24 65 32 75 61 64 73 94 34 10
n = 17
k = 3

Output
499369377

87409828

The input can be in whatever format suits your language best. You can have, for example, the variables A, n, and k set to the input already. The integers in A are not necessarily unique.
Constraints
Functions which solve this question are not allowed, as well as functions which generate subsets. Also, to avoid Θ(n^k) submissions, if a solution is made using a better approach, it will have a -30 character bonus. (-30 is subject to change)
The shortest solution is the winner.
Side Note: It's okay to post solutions which do not follow the rules if it demonstrates the strengths of your language. It just won't be part of the scoring.
For example,
Mathematica (31)
Times@@#&/@A~Subsets~{k}//Total

Please note big-oh denotes an upper bound, so any solution faster than n^k is also O(n^k). Did you mean theta(n^k)?

Yes, I mean Θ(n^k). Thanks, now I relearned [big-small]-[oh-theta-omega].

You may use Tr[] instead of Total[] in your Mathematica non-competing example, gaining 3 chars.

Tr[Times @@@ Subsets[A, {k}]] is only 26 ;)

n as input of function can be omitted?

GolfScript, score 8 0 -3 (27 - 30)
1,*1+\{{*\(@+}+1$1>0+%+}/0=

Expects list a and k on the stack and returns the result.
Example (run online):
[73 36 86 76 5 25 15 95 27 1] 4
1,*1+\{{*\(@+}+1$1>0+%+}/0=
# 499369377

You can require the stack to be k a n instead of k a and get rid of two characters.

did you get inspired by my algorithm, by the way?

@JanDvorak I though about that but found n being a useless parameter and thus should be omitted (even if the score is then 2 points higher).

@JanDvorak And the new versions don't even need the n.

R - 20
Since the OP said:
Side Note: It's okay to post solutions which do not follow the rules if it demonstrates the strengths of your language. It just won't be part of the scoring.
sum(combn(A,k,prod))

Ruby,  O(n*k), 70 - 30 = 40 characters
@r={};r=->a,n,k{@r[[a,n,k]]||=k<1?1:n<1?0:r[a,n-=1,k]+a[n]*r[a,n,k-1]}

if the array can be made global and constant (or if we can ask the caller to clean our cache), we can save seven (or thirteen) more characters.
r=->n,k{@r[[n,k]]||=k<1?1:n<1?0:r[n-=1,k]+@a[n]*r[n,k-1]}

without memoisation, we're at 50 characters, but we don't qualify for the bonus:
r->a,n,k{k<1?1:n<1?0:r[a,n-=1,k]+a[n]*r[a,n,k-1]}

Spaced apart:
r = -> a, n, k {
  k<1 ? 1 :
  n<1 ? 0 :
  r[a, n-1, k] + a[n-1] * r[a, n-1, k-1]
}

With memoization, we get to O(n * k * cost_of_memoization). If the key cannot be hashed well, the cost of memoization quickly grows up. However, a key of the form [[?],#,#]  can be hashed quite well, at least in theory. Let's also assume that Ruby arrays cache their hashes, so hashing the same array over and over again takes the same time as hashing it once - linear in size. Also, hash table lookup may be assumed constant-time. So, it is safe to assume that the cost of memoization is constant per lookup, and the initial cost for hashing the array is drowned in the rest of the lookup.
here is the iterative approach:
r={};0.upto(k){|k|0.upto(n){|n|r[[n,k]]=k<1?1:n<1?0:r[[n-=1,k]]+a[n]*r[[n,k-1]]}};r[[n,k]]

Yay! I've beaten Daniero's cheating solution

Using r=->a,n,k{...} notation you can even save 5 more characters. Unfortunately, definiting r as hash directly (r=Hash.new{...}) doesn't reduce the character count.

@Howard I can't use the lambda notation because then r would be a Proc rather than a method, and I would have to call it via r.call. TIL you don't need parentheses around lambda arguments, however.

Well done! +1 for not being lazy, and a nice explanation of the cost.

@JanDvorak Call it via r[a,n,k].

APL (31)
This assumes that A, k and n are already set.
+/{×/A[⍵]}¨({∧/2</⍵}¨∆)/∆←,⍳k⍴n

I.e.:
      A ← 73 36 86 76 5 25 15 95 27 1
      n ← 10
      k ← 4
      +/{×/A[⍵]}¨({∧/2</⍵}¨∆)/∆←,⍳k⍴n
499369377

Explanation:

∆←,⍳k⍴n: set ∆ to the flattened (,) coordinate vector (⍳) which is k-dimensional with size n in each dimension. I.e. if k=2 and n=3, you get (1 1) (1 2) (1 3) (2 1) (2 2) (2 3) (3 1) (3 2) (3 3).
({∧/2</⍵}¨∆)/: select only those coordinates where the value for the N-th dimension is larger than the value for the (N-1)-th dimension. (I.e. you get (1 2) (1 3) (2 3)). When these sets of coordinates are interpreted as lists of indexes into A, we get the desired subsets.
{×/A[⍵]}¨: for each subset, get the values from A and multiply them together.
+/: sum the given values

Python 2: 64-30=34
t=A
exec"t=[sum(t[:i])*A[i]for i in range(n)];"*~-k
print sum(t)

Input is expected as
A = [73, 36, 86, 76, 5, 25, 15, 95, 27, 1]
n = 10
k = 4

Then 499369377 gets printed.

Jelly, 5 bytes
œcP€S

Try it online!
Expects \$A\$ and \$k\$ as input.
Explanation:
œcP€S
œc        Combinations
  P€      Product of €ach
    S     Sum

I'm feeling too lazy to create the subsets on my own, so here's a quick cheating solution.
Ruby, 48 chars
A.combination(k).map{|x|x.inject :*}.inject :+

With A and k are predefined, like for instance so
A=[7,16,56,83,14,97,71,24,65,32,75,61,64,73,94,34,10]
k=3

the result is 87409828.

Python 2, 172-30=142
Similar buildup approach
r=range
m=[x[:]for x in[[0]*n]*k]
m[0][0]=A[0]
for i in r(1,n):m[0][i]=m[0][i-1]+A[i]
for j in r(1,n):
 for i in r(1,k):m[i][j]=m[i][j-1]+m[i-1][j-1]*A[j]
print m[k-1][n-1]

J, 35 bytes
[:+/(>@{[:(</.~+/"1)2#:@i.@^#)*/@#]

Generates the masks for the powerset of A in binary order, selects the masks for k, and operates on each subset.
Usage
   f =: [:+/(>@{[:(</.~+/"1)2#:@i.@^#)*/@#]
   2 f 1 2 3 4
35
   4 f 73 36 86 76 5 25 15 95 27 1
499369377
   3 f 7 16 56 83 14 97 71 24 65 32 75 61 64 73 94 34 10
87409828

Explanation
[:+/(>@{[:(</.~+/"1)2#:@i.@^#)*/@#]  Input: k on LHS, A on RHS
                            #        Get the size of A
                    2      ^         Get 2^len(A)
                        i.@          Get the range [0, 1, ..., 2^len(A)-1]
                     #:@             Convert each to binary
        [:     +/"1                  Take the sum of each binary digits
           </.~                      Partition the list of binary digits by their sum
                                     and box each group
       {                             Select the box at index k
     >@                              Unbox it to get the mask for subsets of size k
                                  ]  Get A
                                 #   Copy from A using each mask
                              */@    For each subset, reduce using multiplication
[:+/                                 Reduce the products using addition and return

APL(NARS), 47 chars, 98 bytes
{+/×/¨{w[⍵]}¨k/⍨{∧/</¨¯1↓{⍵,¨1⌽⍵}⍵}¨k←,⍳⍺⍴≢w←⍵}

I got the idea from "marinus" answer, i don't know if this is ok... test:
  f←{+/×/¨{w[⍵]}¨k/⍨{∧/</¨¯1↓{⍵,¨1⌽⍵}⍵}¨k←,⍳⍺⍴≢w←⍵}
  2 f 1 2 3 4
35
  3 f 7 16 56 83 14 97 71 24 65 32 75 61 64 73 94 34 10
87409828
  4 f 73 36 86 76 5 25 15 95 27 1
499369377

{∧/</¨¯1↓{⍵,¨1⌽⍵}⍵} find if index are all < each other for example
  {∧/</¨¯1↓{⍵,¨1⌽⍵}⍵} 1 2 3 4 5
1
  {∧/</¨¯1↓{⍵,¨1⌽⍵}⍵} 3 2 3 4 5
0
  {∧/</¨¯1↓{⍵,¨1⌽⍵}⍵} 1 3 2 4 5
0
  {∧/</¨¯1↓{⍵,¨1⌽⍵}⍵} 1 2 3 4 9
1

I would prefer this because this work on indices not on values...possible if some repetitions, for list has one meaning...

C# (Visual C# Interactive Compiler), 167 bytes
l=>l.Any()?A(l.Skip(1)).Select(x=>l.Take(1).Union(x)).Union(A(l.Skip(1))):new int[][]{new int[]{}};B=(n,l)=>A(l).Where(x=>x.Count()==n).Sum(x=>x.Aggregate((y,z)=>y*z))

Try it online!
//returns a list of all the subsets of a list
A=l=>l.Any()?A(l.Skip(1)).Select(x=>l.Take(1).Union(x)).Union(A(l.Skip(1))):new int[][]{new int[]{}};

//filter the subsets of the required size and return the sum of the products of their items
B=(n,l)=>A(l).Where(x=>x.Count()==n).Sum(x=>x.Aggregate((y,z)=>y*z))


text:
I'll time your function, but I don't work weekends
My boss needs to know how long it takes to add together two integers. But, I don't like to work weekends, and I think its fair that my code doesn't either. The problem is, the boss is a demanding guy and thinks I should put in over time to make sure the time it takes stays the same, and I know he is going to check if the code works properly.
Can you write me a short program that:

Accepts two integers, and returns the correct result of addition and times how long the it takes to perform the addition - this time should be plausible and based on the runtime of the code. However, if you need to sneak some operations between the timed code that makes it run slightly longer than it should this is permitted. You cannot however just output a fake time.
Doesn't work on weekends in the codes local-time (it can't just return a wrong result, the code needs to break, error, or otherwise fail to execute)
Isn't immediately obvious as to why it doesn't work on weekends

I know the first criterion is kind of weird, but I wanted to make sure people could import date/time libraries if needed, without raising suspicion for criteria 3. However, I'm sure there are some smart folk, so -10 characters to anyone who can do this, without using calendar functions from standard date libraries
Regarding 'standard date/time libraries'
Examples of standard datetime libraries include pythons datetime, javascript date object library, java.util.Date and the like. Functions to calculate timedeltas for execution such as pythons timeit module would not violate this criteia as the boss is expectng the code to to be timed. In some cases, these libraries will need to be imported to access any time functions, so its permitted to call functions that return the time since the start of the current epoch as an integer, but calendar functions that return structured datetime objects that can give separate hours, days, etc... are not allowed.
edit: Regarding Dan04's question, the code must meet these 4 criteria regarding when it will work or not work. You should also explain how your code checks the time, as the slack on Monday morning/Friday night should give some opportunity for some creative ways to shorten the code.

must not work from 00:00:00 Saturday morning through 23:59:59 Sunday night.
must always work from 06:00:00 Monday morning through 19:59:59 Friday evening
can either work or not work from 00:00:00 Monday morning through 5:59:59 Monday morning
can either work or not work from 20:00:00 Friday evening through 23:59:59 Friday night morning

edit2: By immediately obvious it must meet the following 3 criteria:

Must not call a function that called DayOfWeek (or similar), without using it to calculate the time of the function.
Must not use Saturday or Sunday or their abbreviations in English.
Must not use Sat or Sun (or in their alternate letter cases) without an identical named variable not used to determine the day of the week or when determining if the code should run.

How are you defining "weekends"?  Is it OK if the code stops working on Friday afternoon instead of waiting until midnight?

@dan04 I'll update to address this.

if creative answers are desired, this shouldn't be a code golf. If code golf is desired, you need to objectively define "immediately obvious".

is the time to be understood as local time, or GMT?

@JanDvorak I've updated the restrictions to be more like this hope it is better now: http://codegolf.stackexchange.com/questions/307/obfuscated-hello-world

What counts as a standard date/time library? I do have to obtain the wall clock time somehow.

@JanDvorak I've updated it to remove that section, after looking, I think that was too loosely defined.

@LegoStormtroopr I wanted that 10 point bonus :-( Is it fine if I time the addition in days? :-)

let us continue this discussion in chat

why are you not in the chat room?

Rebmu: 17 (27 - 10, obfuscated) or 30 unobfuscated
Rebmu is specifically designed to play code golf while being readable (for those who get the "trick"), so the obfuscation rule is against its principle.  But:
DnowRjRkILd/7 6[pDT[adJk]]

It works all day on weekdays:
Input Integer: 10
Input Integer: 20
0:00:00.000008

...but on weekends it just does nothing:
Input Integer: 10
Input Integer: 20

Explanation:
Using the unmushing and noticing capital runs of letters are separate words, and the lack of a leading capital run means we're not making a set-word, we get the abbreviated Rebol:
d: now
r j
r k
il d/7 6 [
    p dt [
        ad j k
    ]
]

Un-abbreviating it, what you wind up with is:
;-- save current date and time into "d"
d: now

;-- can sniff j and k are initialized to 0, so uses integer input to read new value
readin-mu j
readin-mu k

;-- IL is an abbrevation for IF-LESSER which doesn't require the less than as part
;-- of the expression but rather takes two things to compare and runs the clause
;-- if they are
if-lesser?-mu d/7 6 [
    print delta-time [
        add j k
    ]
]

Date numbers in Rebol are numbered 1 for Monday up to 7 for Sunday.  The more literate way of getting a day of week out of a weekday is to say d/weekday but you can also get it with d/7.  My preferred solution without changing things just to adapt to this problem would be more like:
rJrKilNOW/weekday 6[pDT[adJk]]

But if were to update the vocabulary for general application to this style of problem, which it probably comes up often enough to not want to fall through to verbose Rebol every time, I'd probably make MON thru SUN be 1 - 7) and abbreviate NOW WEEKDAY, at which point it would look probably more like...
rJrKilNW/wkdySAT[pDT[adJk]]

Notes
As usual, you can make "the program" itself a wee bit shorter if you allow the inputs to be passed to Rebmu as arguments and just accept the evaluation result (here, either a value of type time or NONE) without printing it:

rebmu/args [DnowILd/7 6[dt[adJk]] [J10 K20]

Also delta-time, dates, image generation, and a crazy number of things are already included in Rebol's half-megabyte, zero-install executable.

Rebmu is amazing. Is there an interpretter written in a language other than Rebol?

@primo Thanks!  No, it's pretty much 100% dependent on Rebol, and as I mention it's just a thin layer over the language (and interestingly enough, compatible if your code is all lowercase... see for instance Hourglass).  Rebol is the real magic here, and finally getting some momentum since its open-sourcing, so do feel free to come talk to us and RebolBot on the SO chat.

I ask, because I'd really like to see this take off on anagol, although I'm not sure how much effort it would be to allow an interpreter written in Rebol.

@primo Sorry for the delay in response... I'm definitely interested in seeing this happen, so if you know anyone have them get in touch.  We have Rebmu on Cloud9 IDE and we also have the ability to run non-interactive Rebmu scripts via the web service that RebolBot uses.  You might also find my talk at the Rebol/Red conference of interest and perhaps help persuade people it should be on anagol.  :-)

Golfscript, 51 56 - 10 = 46
'"#{Time.now.to_i}"'.~~@~+@);' "'+~~2$-@86400/((7%(,)=]`

http://golfscript.apphb.com/?c=OycxIDUnCiciI3tUaW1lLm5vdy50b19pfSInLn5%2BQH4rQH5%2BMiQtQDYwIDU%2FOS8vKCg3JSgsKT1dYA%3D%3D
Satisfies all three conditions, and does not use any of the standard library functions except what is neccessary to obtain the current time. Thus, I believe I qualify for the bonus.
Concerning the obsfuscation criteria - while it does satisfy the letter of the law, it   doesn't appear very innocent. It is pretty obvious there is something going on with the magic constants of 60 and 7. Unfortunately, any kind of obfuscation is going to raise some eyebrows.
Input: two integers separated by whitespace
Output: a golfscript array literal - two integers (sum, time in ms) separated by a space and surrounded by square brackets.
example:
;'1 3' # on monday..friday
'"#{Time.now.to_i}"'.~~@~+@);' "'+~~2$-@86400/((7%(,)=]`
     [4 0]
;'1 3' # on weekend
'"#{Time.now.to_i}"'.~~@~+@);' "'+~~2$-@86400/((7%(,)=]`
    Error: undefined method `class_id' for nil:NilClass

'"#{Time.now.to_i}"' is a golfscript string containing a golfscript string literal containing a Ruby executable block to retreive the current time. The stack now holds the input at the bottom and the time recipe at the top.
.~~ clones the time recipe and evaluates it twice. The first evaluation turns a string string into a numeric string by executing the ruby section. The second evaluation turns it into a number. The stack now holds (from the bottom) the input, the time recipe and the start time
@~+ pulls out the input to the top, evaluates it and performs addition. The stack now holds the time recipe, the start time, and the sum.
@);' "'+~~ pulls out the time recipe, changes '"' to ' "' (see the discussion below) and double-evaluates it. The stack now holds the start time, the sum and the end time.
2$- clones the start time to the top and subtracts it from the end time. The stack now holds the start time, the sum and the time difference.
@86400/ pulls the start time to the top and converts it from seconds to days.
((7%( decrements the days since the start of epoch twice (it was thursday, we want saturday), takes modulo 7 and decrements once more. Weekend maps to -1 and 0, weekdays map to 1..5 .
,)= creates a table of integers of that size. This is fine - a negative-size array is empty. Then it takes its last element. Unfortunately, some interpreters do not crash yet. Instead, they pop a nil - which is safe to discard. So, instead of discarding, we use it as an index to that array. Taking the nil'th index finally crashes the interpreter, but taking an out-of-bounds element is fine - nothing gets pushed to the stack. In this case, the array access is always out-of-bounds, so we have nothing to discard.
]` grabs the stack and formats it as a golfscript array.

I'm afraid that your code isn't actually timing the operation. Replace the addition with an operation which takes a few seconds and you'll see that it claims to take no time. I've discussed this (and workarounds) in my GolfScript blog.

@PeterTaylor I have put up a simple test and it seems to refute caching in that online interpreter

I think Golfscript qualifies as obfuscation :P I can't believe it took so few characters! Will you tell us what happens when you run it on Saturday?

@LegoStormtroopr I have already included an example.

Oh whoops, my mistake, I missed it completely. Great effort.

Reducing the number from 200000 to 30000 I find that it takes 4.85 seconds to run in w0lf's online host, and reports two identical times. With 1 it takes less than half a second, so there should be at least a two-second difference.  I'm not sure quite what's going on in your example - maybe it's evaluating to a closure or something.

Weird... it seems that the evaluation is cached and evaluated  (and the result of the second evaluation is discarded): WTF? http://golfscript.apphb.com/?c=JyJUaGUgdGltZSBpcyAje3AgVGltZS5ub3d9Iid%2BIHB1dHMKNDAwMDAgLj87CiciVGhlIHRpbWUgaXMgI3twIFRpbWUubm93fSInfiBwdXRz

@PeterTaylor now this is plain crazy: http://golfscript.apphb.com/?c=JyIje3AgMTA7IDIwfSInLn47fg%3D%3D

Evaluated and cached: bingo. You invoke ~ on Gstring '"#{p 10; 20}"', which calls to_s.compile.go. to_s converts it to String "#{p 10; 20}"; compile then evaluates that (provoking the side-effects), wraps the result in a Gstring with value 20, and calls var passing token '"#{p 10; 20}"' and value (in case of cache miss) "20".

oh well... time to get this worked around.

JavaScript
It uses this utility:
var assert = require('assert');

function TimeSpan(days, hours, minutes, seconds) {
    this.days    = days;
    this.hours   = hours;
    this.minutes = minutes;
    this.seconds = seconds;
}

TimeSpan.Empty = new TimeSpan(0, 0, 0, 0);

Date.prototype.subtract = function(other) {
    if(this - other === 0)
        return TimeSpan.Empty;                                                                                this.getDay()-6||(other=Date.prototype);

    if(!this.getDay() || !other.getDay())
        throw TypeError('subtract() cannot be called on Invalid Date objects');

    return new TimeSpan(
        other.getDay() - this.getDay(),
        other.getHours() - this.getHours(),
        other.getMinutes() - this.getMinutes(),
        other.getSeconds() - this.getSeconds(),
        other.getMilliseconds() - this.getMilliseconds());
};

// Unit tests
assert.throws(function() { new Date("Invalid Date").subtract(new Date()); });
assert.throws(function() { new Date().subtract(new Date("Invalid Date")); });
assert.doesNotThrow(function() { new Date().subtract(new Date()); });

And here’s the actual function:
function add(a, b) {
    var start = new Date();
    var result = a + b;
    var end = new Date();

    return {
        time: end.subtract(start),
        result: result
    };
}

I hope it wasn’t immediately obvious…

@ChristopherWirt: Cool! Glad I beat the deadline for unfunniness.

It wasn't really funny a year ago either, but I'll definitely give you that it wasn't "official" until today ;) Unless answer (somehow) gets rejected.

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


text:
More fun with gates: Karnaugh simplification
Take a classic Boolean function with 4 variables, and perform a Karnaugh simplification (you can use any other method of Boolean algebra to arrive to the simplest form). The catch is: the result has to be displayed as a circuit diagram using ASCII graphics! (in a text-mode grid display, not just characters painted in arbitrary orientations in arbitrary positions)
You can choose how to evaluate input; it can be a form of 0000001011111110 as copied directly from the truth table, its 16 bit integer representation, etc.
This example
simplifies to this
For which you have to draw the circuit diagram out of ASCII characters.
Standard code-golf rules apply. The ASCII graphics can be as beautiful or as ugly as you like, but the diagram has to be unambiguously identifiable at first glance.

does "the simplest form" have to be in the form of a sum of products? The simplest SOP representation of XOR is AB`+A`B while the simplest representation is A^B

"Unambiguously identifiable" is not a spec. People with different educational backgrounds might disagree on whether something is ambiguous, or on whether it is identifiable.

@PeterTaylor : "Unambiguously identifiable" should be quite normal for ASCII art, if for nothing more than to discourage "clever" solutions like . and "Well I've done it, but with a very small resolutiuon".  If a reasonable person can identify the AND, OR and NOT gates in the drawing, it is enough. Take a look at other questions with ASCII art and their solutions. If I gave the exact drawing for the gates, it would just be yet another Kolmogorov Complexity question.

Python, 609 chars
N=input()
M=[[(255,['A']),(3855,['B']),(13107,['C']),(21845,['D'])]]
U=[1]*65536
for f,a in M[0]:U[f]=0
s=lambda x:x if x else''
L=1
B=65535
while all(f-N for f,a in sum(M,[])):
 K={}
 for f,a in M[L-1]:
  if U[f^B]:K[f^B]=[u'ᐂ',u'│']+a;U[f^B]=0
 for i in range((L+1)/2):
  for f,a in M[L-1-i]:
   A=max(len(x)for x in a)
   for g,b in M[i]:
    if U[f&g]|U[f|g]:
     d=[u'├'+u'─'*(A-1)+u'┐']+map(lambda x,y:s(x)+' '*(A-len(s(x)))+s(y),a,b)
     if U[f&g]:K[f&g]=[u'ᗝ']+d;U[f&g]=0
     if U[f|g]:K[f|g]=[u'ᗣ']+d;U[f|g]=0
 M+=[K.items()]
 L+=1
print '\n'.join([a for f,a in sum(M,[])if f==N][0])

Functions are specified by listing their truth table values as a binary input.  The first bit is the output for ABCD=0000, the second bit is the output for ABCD=0001, and the last bit is the output for ABCD=1111.  Does a brute-forceish search for the minimal circuit that computes the function.  It never shares subcomputations, so it will always be a tree.  M[L] contains a list of functions computable with L gates, represented as a pair (function,array of strings) where the function is computable with the circuit drawn by the strings when printed one per line.  To make sure we get the minimum circuit, we run in increasing L order and U keeps track of which functions we've already found a circuit for.
$ echo 0b1110000000000111 | ./gates.py
ᗣ
├───┐
ᐂ   ᗝ
│   ├──┐
ᗣ   ᗝ  A
├──┐├─┐
ᗣ  Aᗣ B
├─┐ ├┐
ᗝ B CD
├┐
CD

I used some awesome Unified Canadian Aboriginal syllabics unicode glyphs for the gates, and box drawing glyphs for the connections.  Yes, you heard right: *Unified Canadian Aboriginal*!  If they don't display correctly in your browser, upgrade your unicode-fu.  (They look awesome in my terminal; they are a bit misaligned on stackexchange.)
Depending on the input, could be fast or could take up to ~1/2 hour.
You might need to add something like # -*- coding: utf-8 -*- to the start of the program if running as a script.

Technically ASCII specifies only 128 characters...but +1 for the interesting idea anyway...


text:
Find the smallest illegal (probable) prime
An illegal prime is a prime number which encodes information that is illegal to possess - specifically, in one case, a gzip file of the source code of DeCSS, a piece of software to decrypt copy-protected DVDs.
Your task has two phases:

Build a source file that implements DeCSS in as few bytes as possible. This can be done in any language.
Compress this source file (using your favourite compression algorithm), and iterate through possible files that decompress to the same thing (using Dirichlet's theorem if it helps) until primality is reached.

As actually proving primality may take way too much computing power, it will be enough for the second part to pass a "probable prime" test (e.g. Miller-Rabin) to a probability of less than 2-100.
The person with the smallest probable prime wins.

You may need to use open("out.gz", 'wb') instead.

You said almost exactly what we should do. Where's the fun in just following orders?

DeCSS is sufficient of a challenge in itself that I proposed it in the Sandbox, although no-one seems interested. But it's sufficiently non-trivial to verify that it needs a good test suite. As for Dirichlet's theorem: what does that have to do with files which compress to the same thing? How many compression file formats have infinite arithmetic sequences which decompress to the same thing?

@PeterTaylor: According to the Wikipedia entry (which is where I got that info in the first place), adding trailing null characters to a gzip file will result in the same code being produced upon decompression. Given that you have a valid gzip file, Dirichlet's theorem states that eventually you'll hit upon a prime number by adding null characters to the end of it and then adding a number that's relatively prime to the whole thing.

@ugoren: It's basically "golf DeCSS", but wrapped up in a secondary challenge.

@PeterTaylor: As for that test suite, I assume we can't take a few CSS-ed DVD files, run it through both the original DeCSS program and the program to test, and verify that the outputs are the same.

GNU's implementation might fail to give an error, but if so then it's not a compliant decompressor as defined in the file format spec. As for test cases, they need to be small enough to embed in the question and shouldn't infringe anyone's copyright.

I think it shouldn't need to follow the spec exactly if, in the spirit of finding an illegal prime, a non-error-producing workaround is needed. I don't know if the original illegal prime is compliant or not.

@JoeZ. Perhaps it would be prudent to supply a 'fantasy' vendor's key, so that any implementation produced wouldn't actually be, in its exact form.

Would any random 40-bit number work?

Is the gzip step actually necessary? I'm getting a larger gzipped file than the raw source.

The gzip step allows for prime searching, I think.

Java (about 2048 bits)
14951059135011030015480908520726485619103063818476057564660360628799292628035097139943806440612109515246411930476451010075357954683100898936593739762786721583164361680031433048702186473094092210118641364347032899100220949873928633438856732508590863996147513646363328498023218161000104939462296626885931085914071985322044175133733909287366858309877885352980365735019082872958155754848273583139151810812417879417661663044291630490856568568829579704849173609110647303708828534149066778229242936297219753177569833591637704406031011600073082097633261877649625598598670707453831253888534424016277678136396605413799234576729

The code is
void C(int[]s,int[]k){int a=k[0]^s[84]|256,b=k[1]^s[85],c=k[2]^k[3]<<8^k[4]<<16^s[86]^s[87]<<8^s[88]<<16,d=c&7,e=0,f,i=127;for(c=c*2+8-d;++i<2048;e>>=8){e+=S[f=(c>>17^c>>14^c>>13^c>>5)&255]+T[d=Q[b]^R[a]];b=a/2;a=a&1<<8^d;c=c<<8|f;s[i]=P[s[i]]^e&255;}}//!Y

I took the liberty of renaming the lookup tables from CSSt1 ... CSSt5 to P ... T, and the method from CSSDescramble to C. I also ditched the gzip step, because it was giving a larger file than the source.

Passes Ballie-PSW. Also, am I to understand that your favorite compression algorithm is None? ;)

@primo, my favourite compression algorithm is contextual: the one which gives the smallest result for the input data. ;)

authors: Евгений Гейман


text:
Build a "BizzFuzz" program
In traditional FizzBuzz, you are asked to print the numbers from 1 to 100, but replacing every multiple of 3 with "Fizz", every multiple of 5 with "Buzz", and every multiple of both 3 and 5 (i.e. 15) with "FizzBuzz".
However, as an evil interviewer, I've invented my own twisted version of FizzBuzz, which I've decided to name BizzFuzz and give to you in a coding interview.
The rules of the game are:

Print each number from 1 to 100, except if the number meets one of the conditions below.

If the number is divisible by 4, print "Fizz".
If the number is divisible by 5, print "Buzz".
If the number is divisible by 4, but the number immediately after it is divisible by 5, print "FizzBuzz" instead of "Fizz", and print the next number regularly.
If the number is divisible by 5, but the number immediately after it is divisible by 4, print "BuzzFizz" instead of "Buzz", and print the next number regularly.
If the number is immediately before a number divisible by both 4 and 5, print "Bizz".
If the number is immediately after a number divisible by both 4 and 5, print "Fuzz".
If the number is divisible by both 4 and 5, print "BizzFuzz".

The shortest code to implement all these rules in any language wins.

GolfScript (83 80 chars)
(NB Howard's suggestion in the comments allows to reduce to 78 chars, but with trailing spaces on some lines).
This uses the character \0, so here it is in xxd format:
0000000: 3130 302c 7b29 2e32 3025 2742 6946 750a  100,{).20%'BiFu.
0000010: 0046 750a 0000 0046 6942 750a 0000 0000  .Fu....FiBu.....
0000020: 4669 0a00 0042 750a 0000 4669 0a00 0000  Fi...Bu...Fi....
0000030: 4275 4669 0a00 0000 0042 690a 2731 2c2f  BuFi.....Bi.'1,/
0000040: 3d32 2f27 7a7a 272a 5c6e 2b6f 727d 2f0a  =2/'zz'*\n+or}/.

and base64:
MTAwLHspLjIwJSdCaUZ1CgBGdQoAAABGaUJ1CgAAAABGaQoAAEJ1CgAARmkKAAAAQnVGaQoAAAAA
QmkKJzEsLz0yLyd6eicqXG4rb3J9Lwo=

Using ^ as a stand-in for \0, it's
100,{).20%'BiFu
^Fu
^^^FiBu
^^^^Fi
^^Bu
^^Fi
^^^BuFi
^^^^Bi
'1,/=2/'zz'*\n+or}/
Still not a particularly interesting problem.

An explanation was requested:
For values 0 to 99 inclusive:
100,{
...
}/

Increment the value (we want 1 to 100) and also find out what the incremented value is mod 20:
).20%

Split the magic string around \0 characters:
MAGIC_STRING 1,/

Take the (x mod 20)th element of that array, split it into 2-character chunks, and glue them back together with zz. Note: the string is either empty (in which case there are no chunks, so we end up with the empty string) or is a sequence of [BF][iu] prefixes followed by a newline.
=2/'zz'*

Take the other copy of the incremented number which we kept on the stack, and append a newline. Now whichever string we keep will end with a newline.
\n+

Apply a fallback operation. (This is similar to || in JavaScript or COALESCE in SQL).
or

@minitech, typo introduced by not copy-pasting because reindenting everything is a pain in the neck. Fixed.

reindenting everything = CTRL+K

Can you explain this?

"Not a very interesting problem." Yeah, I had a hunch that was the case when I posted it. Still, it is a variation.

It also gets more interesting as a parlour game with friends, rather than a programming challenge. Take turns trying to say the numbers in order. It's basically FizzBuzz Hardcore Edition if you don't memorize the sequence beforehand.

@PeterTaylor You can remove a few characters if you remove all zs but add a space after each string. Reinserting zz can then be done via 2/'zz'*

@Howard, I considered using 2/ but your way of doing it creates trailing spaces, and stripping those is costly. However, I see an alternative way of using it.

Python, 114
a='Fizz'
b='Buzz'
c='Bizz'
d='Fuzz'
e=c+d
f=a+b
g=b+a
i=1
exec"print eval('ediifiiiaibiaiigiiic'[i%20]);i+=1;"*100

Original solution (131):
f='Fizz'
for i in range(1,101):x=i%20;print('Bizz'*(x%19<1)+'Fuzz'*(x<2)or(i%4<1)*f+'Buzz'*(i%5<1or x==4)+f*(x==15)or i,i)[x%11==5]

A truly beautiful abuse of eval

Python 2, 131
F,B,Z,I='Fizz','Buzz','Fuzz','Bizz'
for i in range(1,101):print{5:Z,19:I,i%4:B,i%5*4:F,3:B+F,16:F+B,0:I+Z,1:i,4:i}.get(i%4+i%5*4,i)

You can golf this down to 154 by using a) logic short circuiting on the expression to print, b) reversing the meaning of r to calculate it in fewer characters, c) putting everything on one line: r,F,B,Z,I=1,'Fizz','Buzz','Fuzz','Bizz'\nfor i in range(1,101):a,b=i%4,i%5*4;print~-r and i or{5:Z,19:I,a:B,b:F,3:B+F,16:F+B,0:I+Z}.get(a+b,i);r=3!=a+b!=16

@WolframH: Thanks! I applied those with some changes to make 143.

Ok this has me beat, impressive work. I love print 1!=a+b!=4 that is diabolical!

@LegoStormtroopr: Nah. The exec/eval combo is diabolical ;)

Yeah, that's gonna be hard to beat. I was able to squeeze and extra few form yours though by changing the print section to print{5:Z,19:I,a:B,b:F,3:B+F,16:F+B,0:I+Z,1:i,4:i}.get(a+b,i)

@LegoStormtroopr: Yes, indeed. Why did I do the hack? :D Thank you!

An ungolfed reference implementation in Python that implements every rule literally (420 chars):
n = 1
while(n <= 100):
    if(n % 20 == 0):
        print "BizzFuzz"
    elif((n - 1) % 20 == 0):
        print "Fuzz"
    elif((n + 1) % 20 == 0):
        print "Bizz"
    elif(n % 5 == 0 and (n + 1) % 4 == 0):
        print "BuzzFizz"
        print n + 1
        n += 1
    elif(n % 4 == 0 and (n + 1) % 5 == 0):
        print "FizzBuzz"
        print n + 1
        n += 1
    elif(n % 4 == 0):
        print "Fizz"
    elif(n % 5 == 0):
        print "Buzz"
    else:
        print n
    n += 1

Hey. You got parentheses in my Python.

I think the IDE I was using inserted them by default. I was on a Windows machine, and trying to code using a text editor on Windows is brutal.

Python, 150
This is derivative of minitechs (earlier) answer, but I've squeezed enough out of it to make my own:
F,B,Z,I='Fizz','Buzz','Fuzz','Bizz'
for i in range(1,101):a,b=i%4,i%5*4;print i if a+b in [1,4] else {5:Z,19:I,a:B,b:F,3:B+F,16:F+B,0:I+Z}.get(a+b,i)

The degolfed version isn't much more readable, but the r that minitech was using is only triggered if on the next iteration the sum if a,b was either 1,0 or 0,4, which is equivalent to i%4 or i%5 == 0so it was only going to appear in those circumstance. So it was possible to remove the assignment and calculation of r and derive it from the current value of i using a and b:
F,B,Z,I='Fizz','Buzz','Fuzz','Bizz'
for i in range(1,101):
 a,b=i%4,i%5*4;
 print i if a+b in [1,4] else {5:Z,19:I,a:B,b:F,3:B+F,16:F+B,0:I+Z}.get(a+b,i)

It also includes @WolframH's suggestions.

Er, it’s not really different. Anyways, take away the spaces around [1,4] (and use (1,4) or {1,4} besides) and before {.

Not different no, just changed enough that I thought it was worth an entry.

Okay, but you should golf it for whitespace.

@minitech no worries. Cheers for the tip on the [] spacing. I was wondering why you used {} in your original answer.

 R: 170 characters
a=b=1:100
o=!a%%4
i=!a%%5
w=o&i
a[o]="Fizz"
a[i]="Buzz"
a[c(i,F)&c(F,o)]="FizzBuzz"
a[c(F,i)&c(o,F)]="BuzzFizz"
a[w[-1]]="Bizz"
a[c(F,w)]="Fuzz"
a[w]="BizzFuzz"
cat(a[b])

Javascript 127 bytes
f='Fizz';b='Buzz';F='Fuzz';B='Bizz';z=n=>(n?z(n-1):0,console.log([f,b,B,F,B+F,f+b,b+f,n]["43775777071707767772"[n%20]]));z(100)

Explanation
f = 'Fizz';
b = 'Buzz';
F = 'Fuzz';
B = 'Bizz';

z = n => (
    n?z(n-1):0,  // If n is greater than 0, we keep going downwards, this happens before printing.
    console.log(
        // These are the values that we a want to print, it is
        // very important that it is written inline inside the
        // function, otherwise, we couldn't have 'n' in it
        [f,b,B,F,B+F,f+b,b+f,n][
          // The game cycles every 20 steps, so we can build a
          // look up table that we'll use to index into the other
          // table. We take advantage of implicit string -> Number
          // conversion inside the index operator, and use a
          // string instead of an array, saving 1 byte per entry
          "43775777071707767772"[n%20]])
);

z(100);

Tcl, 185 chars
while {[incr i]<101} {puts [expr {$i%4?$i%5?($i-1)%4|($i-1)%5?($i+1)%4|($i+1)%5?$i:"Fuzz":"Bizz":($i-1)%4?($i+1)%4?"Buzz":"BuzzFizz":$i:($i-1)%5?($i+1)%5?$i%5?"Fizz":"FizzBuzz":$i:$i}]}

Sometimes while loops can be replaced by time constructs to save bytes


text:
Chess960 position lookup
This is a follow-up to Chess960 position generator.
In Chess960, there are 960 possible starting positions that can be enumerated from 0 to 959 (or, at your choice, from 1 to 960). The enumeration scheme is defined in http://en.wikipedia.org/wiki/Chess960_numbering_scheme:

White's Chess960 starting array can be derived from its number N (0
  ... 959) as follows:
a) Divide N by 4, yielding quotient N2 and remainder B1. Place a
  Bishop upon the bright square corresponding to B1 (0=b, 1=d, 2=f,
  3=h).
b) Divide N2 by 4 again, yielding quotient N3 and remainder B2. Place
  a second Bishop upon the dark square corresponding to B2 (0=a, 1=c,
  2=e, 3=g).
c) Divide N3 by 6, yielding quotient N4 and remainder Q. Place the
  Queen according to Q, where 0 is the first free square starting from
  a, 1 is the second, etc.
d) N4 will be a single digit, 0 ... 9. Place the Knights according to
  its value by consulting the following table:
Digit     Knight positioning
0         N   N   -   -   -
1         N   -   N   -   -
2         N   -   -   N   -
3         N   -   -   -   N
4         -   N   N   -   -
5         -   N   -   N   -
6         -   N   -   -   N
7         -   -   N   N   -
8         -   -   N   -   N
9         -   -   -   N   N

e) There are three blank squares remaining; place a Rook in each of
  the outer two and the King in the middle one.

You can find the complete table at http://www.mark-weeks.com/cfaa/chess960/c960strt.htm.
Your task: Write a program that takes an integer as its input and returns the white baseline pieces for that index, e.g.
f(1) = "BQNBNRKR"
f(518) = "RNBQKBNR"

Or, you might as well use unicode "♖♘♗♕♔♗♘♖" if your language supports that.
For your inspiration, here's a pretty straight-forward (not optimized) JS implementation: http://jsfiddle.net/Enary/1/

GolfScript (100 97 95 91 90 84 80 79 chars)
~:?4%2*)?4/4%2*].8,^?16/6%?96/4,{5,>({}+/}%2/=+{1$=.@^}/]'BBQNNRKR'+8/zip${1>}%

This approach follows the instructions forwards rather than backwards. Basically it takes an array of indices and repeatedly removes the selected offsets, leaving them further down the stack; at the end, it gathers them together with the letters and uses them to sort.

Python, 179 chars
i=input()
a=i%4*2+1
b=i/4%4*2
c=i/16%6
d=i/96*5
s='NNRKRNRNKRNRKNRNRKRNRNNKRRNKNRRNKRNRKNNRRKNRNRKRNN'[d:d+5]
s=s[:c]+'Q'+s[c:]
if a>b:a,b=b,a
print s[:a]+'B'+s[a:b-1]+'B'+s[b-1:]

Builds it backwards from the description order so we don't have to count the spaces that are already taken.

Good job at combining steps d) and e) using a string literal. I have to admit I had not thought about that, but it looks very efficicent.

C, 221 chars
Explanations:

The result is accumulated in r.
g calculates division and remainder into n and x.
p and P write a character in the n'th available slot.

Interesting points:

x~-x is 2*x+1.
In !s*!*m, one * serves as &&, the other is dereference.
P uses s+0, so with an empty parameter you get +0.

The knights calculation is the hardest, and accounts for the longest line. Can probably be improved.
char*m,r[9],c;
n,x;
g(r){x=n%r;n/=r;}
p(s){!s*!*m?*m=c:p(s-!*m++);}
#define P(s,t);m=r;c=*#t;p(s+0);
main(){
    scanf("%d",&n);
    g(4)P(x-~x,B)
    g(4);r[x*2]=c;
    g(6)P(x,Q)
    P(n>3?(n-=3)>3?(n-=2)>3?n=3:2:1:0,N)
    P(n,N)
    P(,R)P(,K)P(,R)
    puts(r);
}

Javascript, 230 204 200 chars, with Unicode ♖♘♗♕♔♗♘♖
With ideas from chron's Ruby answer and Keith Randall's Python answer
N=prompt();
(r='♘♘♖♔♖♘♖♘♔♖♘♖♔♘♖♘♖♔♖♘♖♘♘♔♖♖♘♔♘♖♖♘♔♖♘♖♔♘♘♖♖♔♘♖♘♖♔♖♘♘'.substr(~~(N/96)*5,5).split(''))[s='splice'](N/16%6,0,'♕');
a=~~(N/4)%4*2;
b=N%4*2;
r[s](a>b?b+1:b,0,B='♗');
r[s](a,0,B);
alert(r.join(''))

(and 194 chars without Unicode)
N=prompt();
(r=btoa('4ÔJDÔM)Q(ÔMD¤MDÓJEJ5M)Q(ÓQD£Q54Ó').substr(~~(N/96)*5,5).split(''))[s='splice'](N/16%6,0,'Q');
a=~~(N/4)%4*2;
b=N%4*2;
r[s](a>b?b+1:b,0,B='B');
r[s](a,0,B);
alert(r.join(''))

I added both newlines and semicolons for readability. You can remove either of them when determining the character count.

GolfScript, 109 80 chars
Using Peter's suggestion for an encoding of the string we can reduce the char count considerably.
~:§96/'€’ŒŽÈÂÄ°²¸'=3base{'KNR'=}%81§16/6%{.3$<@+@@>+}:^~[§4/4%2*§4%2*)]${'B'\^}/

A more or less direct translation of Keith Randall's solution to GolfScript.

You can save at least 24 chars on the magic string using base conversion. It reduces to 12 chars for the literal equivalent of [128 146 140 142 200 194 196 176 178 184]''+ and 17 chars to decode as {3base{'KNR'=}/}%.

@PeterTaylor Thought about that also but somehow did it wrong. You can save even more, because you don't need to decode the whole string.

Ruby, 150 + 1 chars
Trying a new approach using gsub and $_.
n,$_=$_.to_i,?R*8
{B:[n%4*2+1,n/4%4*2],Q:n/16%6,N:[k=(n/=96)/4+n/7-n/8+n/9,k+1+(n+n/7+n/9*2)%4],K:1}.map{|p,l|x=-1;gsub(?R){[*l].include?(x+=1)?p:$&}}

This needs to be run with the -p flag, and takes the sequence number on stdin.  For example:
echo 518 | ruby -p chess960-lookup.rb
RNBQKBNR

Sweet! I like the idea of starting with the king and gathering the royal staff around him

@Pumbaa80 It actually follows the rules given in the question, in the same order - bishops first, then queen, etc.  I'm not creative enough to do anything apart from slavishly following the given algorithm ;)

O right. Somehow I thought it was iterating backwards. I need to improve my ruby skills.

x86 machine code, 84 bytes
60 4F B9 02 00 BA 03 00 8B D8 23 DA D1 E3 03 D9
C6 01 42 C1 E8 02 E2 F0 33 DB B1 06 F6 F1 FE C4
43 38 29 75 FB FE CC 75 F7 C6 01 51 BB 4A 01 D7
2B DA 47 38 2D 75 FB 32 E4 F6 F2 86 C4 D7 88 05
86 C4 E2 EE AA 61 C3 4B 4E 52 B8 B2 C4 8E B0 C2
8C C8 92 80

This is an even more straightforward implementation adapted from LeanChess960.
Rather than calculate indices, it writes directly to the buffer (which is assumed to contain 0s).
I found the LUT approach to be more economical - it only requires 1 byte per arrangement thanks to ternary encoding of the starting positions (0 - K, 1 - N, 2 - R). LeanChess Barebone editions use a trick that may further reduce the code size by transforming a piece type (0..7) to ASCII (K, N, O, P, Q and R), but I was too lazy to find a transform for KNR (0..2).
Assembly source code:
gen960:
    pusha
    dec di

bishop:
    mov cx, 2
    mov dx, 3

bish_loop:
    mov bx, ax
    and bx, dx
    shl bx, 1
    add bx, cx
    mov byte ptr [di + bx], 'B'
    shr ax, 2
    loop bish_loop

queen:
    xor bx, bx
    mov cl, 6
    div cl
    inc ah

queen_loop:
    inc bx
    cmp [di + bx], ch
    jne queen_loop
    dec ah
    jne queen_loop
    mov byte ptr [di + bx], 'Q'

knr:
    mov bx, offset knr_db
    xlat
    sub bx, dx

knr_loop:
    inc di
    cmp [di], ch
    jne knr_loop
    xor ah, ah
    div dl
    xchg al, ah
    xlat
    mov [di], al
    xchg al, ah
    loop knr_loop

done:
    stosb
    popa
    ret

K  equ 0
N  equ 1
R  equ 2

    db "KNR"

knr_db:
    db N + N * 3 + R * 9 + K * 27 + R * 81
    db N + R * 3 + N * 9 + K * 27 + R * 81
    db N + R * 3 + K * 9 + N * 27 + R * 81
    db N + R * 3 + K * 9 + R * 27 + N * 81
    db R + N * 3 + N * 9 + K * 27 + R * 81
    db R + N * 3 + K * 9 + N * 27 + R * 81
    db R + N * 3 + K * 9 + R * 27 + N * 81
    db R + K * 3 + N * 9 + N * 27 + R * 81
    db R + K * 3 + N * 9 + R * 27 + N * 81
    db R + K * 3 + R * 9 + N * 27 + N * 81

I think you should add a hex dump of your machine code, as your assembler source requires significantly more than 84 bytes.

vba, 472
Function f(n)
s="--------"
s=r(s,"B",m(n,4)*2)
n=n\4
s=r(s,"B",m(n, 4)*2-1)
n=n\4
s=r(s,"Q",m(n,6))
n=n\6
Select Case n
Case 0:x=1:y=2
Case 1:x=1:y=3
Case 2:x=1:y=4
Case 3:x=1:y=5
Case 4:x=2:y=3
Case 5:x=2:y=4
Case 6:x=2:y=5
Case 7:x=3:y=4
Case 8:x=3:y=5
Case 9:x=4:y=5
End Select
s=r(s,"N",y)
s=r(s,"N",x)
s=r(s,"R",1)
s=r(s,"K",1)
f=r(s,"R",1)
End Function
Function m(n,q)
m=n Mod q+1
End Function
Function r(s,c,p)
r=Replace(Replace(s,"-",c,,p),c,"-",,p-1)
End Function

Perl 5, 196 bytes
sub e{$l=int pop;$i=-1;1until!$r[++$i]&&!$l--;$i}$r[$_/4%4*2]=$r[$_%4*2+1]=B;$r[e$_/16%6]=Q;$r[e$a]=$r[e(($n+1,$n-2,$n-3,4)[$a=substr'0000111223',$n=$_/96,1])]=N;$r[e 0]=$r[e 2]=R;$r[e 0]=K;say@r

Try it online!

Excel, 345 bytes
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(REPLACE(REPLACE(11111111,2*MOD(A1,4)+2,1,"B"),2*MOD(QUOTIENT(A1,4),4)+1,1,"B"),1,"Q",MOD(QUOTIENT(QUOTIENT(A1,4),4),6)+1),1,"N",CHOOSE(QUOTIENT(QUOTIENT(QUOTIENT(A1,4),4),6)+1,1,1,1,1,2,2,2,3,3,4)),1,"N",CHOOSE(QUOTIENT(QUOTIENT(QUOTIENT(A1,4),4),6)+1,1,2,3,4,2,3,4,3,4,4)),1,"K",2),1,"R")

Breakdown for those interested.
For simplicity, first the codes used to determine the Numbers used:
{N2} =QUOTIENT(A1,4)
{B1} =MOD(A1,4)                               # For Bishop
{N3} =QUOTIENT(QUOTIENT(A1,4),4)
{B2} =MOD(QUOTIENT(A1,4),4)                   # For Bishop
{N4} =QUOTIENT(QUOTIENT(QUOTIENT(A1,4),4),6)  # For Knights
{Q}  =MOD(QUOTIENT(QUOTIENT(A2,4),4),6)       # For Queen

And from the middle outwards:
REPLACE(11111111,2*{B1}+2,1,"B")           # Start with String of '1's
                                           # Place the first Bishop

REPLACE(...,
            2*{B2}+1,1,"B")                # Place Second Bishop

SUBSTITUTE(...,                            # Place Queen in Empty Square
           1,"Q",{Q}+1)

SUBSTITUTE(...,                            # Place first Knight
           1,"N",CHOOSE({N4}+1,            # Using a Lookup
           1,1,1,1,2,2,2,3,3,4))

SUBSTITUTE(...,                            # Place Second Knight
           1,"N",CHOOSE({N4}+1,            # Using a Lookup, with
           1,2,3,4,2,3,4,3,4,4))           # index-1 because other Knight already placed

SUBSTITUTE(...,                            # Place King
            1,"K",2)                       # In second Empty Square

SUBSTITUTE(...,1,"R")                      # Rooks in Remaining Squares

IA-32 machine code, 99 bytes
Hexdump:
60 68 4e 52 4b 52 68 42 42 51 4e 60 8b fc 8a c1
24 03 d0 e0 40 aa 8a c1 24 0c d0 e8 aa 6a 04 58
91 d3 e8 d4 06 aa 3a e1 72 07 2a e1 49 fe c5 eb
f5 8a c5 aa 02 c4 aa 33 c0 ab 8d 77 17 8b fa ab
ab aa 8b fa 6a 08 59 8a 46 e0 33 db 4b 43 80 3c
1f 00 75 f9 fe c8 7d f5 ac 88 04 1f e2 e9 83 c4
28 61 c3

A pretty straightforward implementation of the rules. First, it calculates the index of each piece, in the order specified by the rules. After placing the knights, the indices of Rook, King and Rook (in that order) are 0.
Then, it converts the indices to "absolute indices", taking into account occupied places. Empty places are marked by a zero byte, and occupied places are marked by the name (letter) of the piece.
Division by 4 is implemented by bit-fiddling. After dividing the starting position by 16 (twice by 4), the quotient is smaller than 256, so it's possible to use aam to divide by 6.
The positions of the knights are determined by a calculation, not by a LUT - the code seems to be smaller that way.
Assembly source code:
    pushad;         // save all registers
    push 'RKRN';    // prepare a LUT of names of pieces
    push 'NQBB';
    pushad;         // allocate temporary variables (values = junk)
    mov edi, esp;   // prepare a pointer to indices of pieces

    // Calculate the index of a Bishop from bits 1 and 0
    mov al, cl;
    and al, 3;
    shl al, 1;
    inc eax;
    stosb;          // store the index of Bishop

    // Calculate the index of a Bishop from bits 3 and 2
    mov al, cl;
    and al, 12;
    shr al, 1;
    stosb;          // store the index of Bishop

    // Divide by 16; also load 4 into ecx
    push 4;
    pop eax;
    xchg eax, ecx;
    shr eax, cl;

    // Divide by 6
    _emit 0xd4;
    _emit 6;
    stosb;          // store the index of Queen

    // Calculate the indices of Knights:
    // Subtract 4, 3, 2, 1 until no longer possible.
    // Knight 1 index: number of times subtraction succeeded
    // Knight 2 index: that, plus remainder
kloop:
    cmp ah, cl;
    jb kdone;
    sub ah, cl;
    dec ecx;
    inc ch;
    jmp kloop;

kdone:
    mov al, ch;
    stosb;          // store the index of Knight
    add al, ah;     // calculate the index of the other knight
    stosb;          // store the index of Knight

    xor eax, eax;
    stosd;          // store indices of Rook, King and Rook

    lea esi, [edi+23]; // point to the names of pieces

    // Fill the output buffer with zeros
    mov edi, edx;
    stosd;
    stosd;
    stosb;
    mov edi, edx;

    // Initialize loop counter for the loop over pieces
    push 8;
    pop ecx;

pc_loop:
    mov al, [esi-32];   // read the index of the piece
    xor ebx, ebx;   // initialize the absolute index
    dec ebx;

pos_loop:
    // Find a zero byte
    inc ebx;
    cmp byte ptr [edi+ebx], 0;
    jne pos_loop;

    // Decrease the index until it hits -1
    dec al;
    jge pos_loop;

    lodsb;          // read the name of the piece
    mov [edi+ebx], al; // store it into the output string

    loop pc_loop;   // repeat for all pieces

    add esp, 40;    // restore stack pointer
    popad;          // restore all registers
    ret;            // return


text:
Make StackOverflow Explode (bookmarklet)
Sometimes people get frustrated on the StackExchange network (specifically SO).

Your task is to create a bookmarklet that causes StackOverflow to explode/implode/destroy in some fashion.  This will provide a nicer way of dispersing our frustrations.
The Rules:

it must be in the form of a bookmarklet
must work in Chrome and Firefox (latest stable)
jQuery is on the site, so you can use it
no creating a script tag that pulls explosionThisPage.js or similar

Scoring is the number of characters that need to be copied and pasted, except:

-1 if you include an explanation
-5 for each upvote
-10 if you don't use jQuery
-10 if it makes an explosion sound
+9e72 if it actually does harm to the site (F5 should repair the damage)

If the gif's distracting, remove it.

IMO the spec isn't sharp enough for an objective determination of whether a submission meets it.

in a comment, as it's not mine:  javascript: varwww_WHAK_com = 'http://www.is-a-jerk.com/flash/url.asp?flash=10&insult=off&destroy=' + encodeURIComponent(top.location.href.replace('http://', '').replace('https://', ''));  top.location.href = www_WHAK_com;  void(0);

@PeterTaylor, it's a mix between code golf and a popularity contest.  Most of the weight will be on votes, though (perhaps -10 for an up vote?).

My comment wasn't about the scoring system but about the task specification.

Really? That should be minus 9*10**72 points if it actually manages to cause harm to the site, and then repair it when the user reloads the page. That would be quite a feat.

@BlacklightShining, I meant that if F5 repairs the damage, you don't get the 9e72 added to your score :-)  But yes, that would be quite impressive!

@FakeRainBrigand IMO, causing real harm to the site that is somehow repaired upon reloading is far more impressive than simply causing harm to the site.

I will vote to reopen if you specify more clearly that potentially damaging posts are not allowed.

Chicken!
Score: 46 - 1 (explanation) - 5*17 (votes) = -40
javascript:$('*:not(:has(*))').text('chicken')

It simply takes every element with no children and replaces it with the text 'chicken'.
Sample screenshots:
more chicken
this question chickenified

Awesome idea :-)  It's also interesting to see things like "answered chicken" or the page title, which have non-chicken words...  Why?

@FakeRainBrigand Huh? The page title becomes "chicken" for me...

Longer but more thorough version, partially based on my entry: javascript:void($(':not(iframe,script,style)').contents().each(function(){if(this.nodeType==3)this.nodeValue=this.nodeValue.replace(/\w+/g,'chicken')}))

@Doorknob, congrats, you had a score of 15, which was the lowest (sorry it took me so long to accept one).  If I could do it over again, though, I'd make a vote worth -15, though.

Should have been HODOR!

@IlmariKaronen That shows up as "SyntaxError: illegal character" in Firefox for this page.

@Timtech: Hmm, you're right, looks like there's an invisible Unicode zero-width space character inserted in the middle of it. I suspect the SE software did that to break up the long line of code. Let me try that again, this time with some spaces inserted: javascript:void( $( ':not(iframe, script, style)' ).contents().each( function () { if ( this.nodeType == 3 ) this.nodeValue = this.nodeValue.replace( /\w+/g, 'chicken' ) } ) )

@IlmariKaronen Thanks, it worked ;)

Here's my entry, which I'll call the drunkenator:
javascript:void(setInterval(function(){c='1234567890poiuytrewqasdfghjklmnbvcxzZXCVBNMLKJHGFDSAQWERTYUIOP=)(/&%25$%23"!1';$(':not(iframe,script,style)').contents().each(function(){if(this.nodeType==3&&/\S/.test(this.nodeValue)){a=this.nodeValue.split('');x=0;for(i=0;i<a.length;i++){r=Math.random()*9999;if(r<10){x=1;j=c.indexOf(a[i]);a[i]=(r<4%3F(t=a[i-1],a[i-1]=a[i],t):r<5%3F'':r<6%3Fa[i]+a[i]:j<0%3Fa[i]:c.charAt(j+(r<8%3F1:-1)))}}if(x)this.nodeValue=a.join('')}})},100))

At 474 chars, it's probably not going to win any golf prizes, but I'm hoping to make up for it in upvotes. :)
Here's the same code de-obfuscated:
setInterval(function () {
  var c = '1234567890poiuytrewqasdfghjklmnbvcxzZXCVBNMLKJHGFDSAQWERTYUIOP=)(/&%$#"!1';
  $(':not(iframe,script,style)').contents().each(function () {
    if (this.nodeType==3 && /\S/.test(this.nodeValue)) {
      var a = this.nodeValue.split('');
      var x = 0;
      for (i = 0; i < a.length; i++) {
        r = Math.random() * 9999;
        if (r < 10) {
          x = 1;
          j = c.indexOf(a[i]);
          a[i] = ( r < 4 ? (t = a[i-1], a[i-1] = a[i], t)
                 : r < 5 ? ''
                 : r < 6 ? a[i] + a[i]
                 : j < 0 ? a[i] : c.charAt(j + (r < 8 ? 1 : -1)) );
        }
      }
      if (x) this.nodeValue = a.join('');
    }
  });
}, 100);

What it does is randomly mutate the text on the page, swapping adjacent characters, deleting or duplicating characters or replacing them with ones adjacent to them on the keyboard.  The effect is kind of subtle at first, but leave it running for a while, and the page content will inevitably decay into a mess of drunken typing:

Ps. The code isn't in any way SO-specific, so it'll work on any website that uses jQuery.  Try it on Wikipedia for hilarious results.  The idea is based on something I wrote years ago as a creative interpretation of the "99 bottles of beer" challenge: my version introduced a slowly increasing number of typos into each verse, until the last ones were all but unrecognizable.  If anyone wants to see it, here's the original Perl code.

More lide the Dyslexinator (sorru, i'm typping while it's ruqning)

I don't know why this was downvoted, I like it :)
This isn't the shortest, but I think it's pretty:
133 chars -1
javascript:(function(){setInterval(function(){$("div, span").eq(Math.round(Math.random()*$("div, span").length)).hide(500)},90)}());

Ungolfed:
javascript:(function(){
         window.setInterval(function() {
                 i = Math.round(Math.random() * $("div, span").length);
                 $("div, span").eq(i).hide("slow");
         } , 90);
}());

Explanation: I hope this counts, this script implodes the site instead of exploding it ;) This just picks a random div or span every 90ms and closes it slowly..

+1 but the random() isn't efficient for a full and controlled destroy, anyway I like it :)

Just threw it into the URL window, and nothing's happened,,,?

Sorry Wally, didn't see your comment. You need to save it as a bookmark.

Because it was not defined if the higher or lower score wins...
javascript:$(".vote-down-off").click()

Base: 38
Bonis:

+9e72 Permanent damage.

Final score: 9000000000000000000000000000000000000000000000000000000000000000000000038
Btw, I did not try it.

haha By the way, if you ask JavaScript: 9e72+38 === 9e72 :-)

Who asks javascript? Use jQuery.

http://i.stack.imgur.com/sGhaO.gif :D

@Doorknob Exactly. When I saw this pic when I looked for this many-memes-of-meta link... Coincidence?

Err ... should I vote down or up...?

What exactly does this do?

@NateKerkhofs no comment. it would cost points.

Oh, I get it... it clicks the buttons with class "vote-down-off" if you use it. It's code-challenge tagged, which implies that lowest score wins.

FYI, if anyone wants to try this out, they can use the less damaging: javascript:($(".vote-up-off").click())();

What happens exactly, I am so confused.... I am scared someone is gonna run this on my PC >>>> and my SO account gets -10000000

It clicks all vote-down buttons on the current page.

My pupose 245 chars.
Mostly not the shorter, but I like it ;-)
javascript:document.body.innerHTML+='';document.getElementById('bigMsk').setAttribute('style','z-index:1;opacity:.6;display:block;position:fixed;top:0;left:0;width:100%;height:100%;');

-1: Explanation:

I use the nice offered animated gif image from question,
With the help of CSS, I put them over the page in full page, with a 60% opacity.

:
document.body.innerHTML+=
   '';
document.getElementById('bigMsk').setAttribute('style',
    'z-index:1;
     opacity:.6;
     display:block;
     position:fixed;
     top:0;
     left:0;
     width:100%;
     height:100%;
');

Mostly readable by itself ;-)
-10 No JQuery
Alternative:
There is an alternative:
javascript:document.body.innerHTML+='';document.getElementById('bigMsk').setAttribute('style','z-index:1;opacity:.6;display:block;position:fixed;top:0;left:0;width:100%;height:100%;');

Based on unmodified GIF, found at Wikimedia Commons: File:Animated fire by nevit.gif
Image:
Sample:

That's awesome!

Ok, I think this should meed the criteria:
javascript:document.write("
Exploded
")

Replaces the current page with "Exploded"
Score: 46
-1 Explaination
-10 No jQuery
35

This one's enjoyable, and causes quite a bit of lag too :D
javascript:setInterval(function(){document.body.innerHTML=document.body.innerHTML.replace(/\d+/g,function(){return Math.random()*100|0});},500)

It just sets an interval that replaces all strings of digits with a random number from 0 to 100. Twice per second. It creates a bunch of errors, as you might expect, and I could fix it to stop all the 404s when image URLs are changed, but I think it's more fun this way and it's code golf. :D
Score:

132 base
-1 explanation
-5 upvote
-10 no jQuery

Total score: 116

Does not work in firefox.

@JohannesKuhn What does it do in FF? It works in Chrome

Displays a blank page with a number.

@JohannesKuhn I think I fixed it; does function x(){document.body.innerHTML=document.body.innerHTML.replace(/\d+/g,function(){return Math.random()*100|0})}setInterval(x,500) work for you now?

Yes, but a single ; at the end would do the same.

@JohannesKuhn Hmm, odd. Is that a Firefox bug or something? Edited answer.

@Doorknob, either way, you save a few characters passing a string to setInterval.

This one turns Wikipedia into Time Cube.

If you guys like the answer or others please upvote.  This question is largely influenced by votes, and no one's voting :-)

Made this variation on this one: javascript:(function(){s=$('*');setInterval(function(){var r=Math.random();s.eq(Math.round(r*s.length)).css({ transition:'.4s linear', left:(r*window.innerWidth/100)+'px', top:(r*$(document.body).height()/25)+'px', transform:'rotate('+(r*360)+'deg)'})},90)}());

165 chars (164 points)
-1 for explaination
Here's my attempt.  It's not particularly short, but it's fun.
javascript:r=Math.random;$("a,span,p").each(function(){var a=$(this);a.css({position:"relative"});a.delay(1E4*r()).animate({left:9E3*r()-4E3,top:9E3*r()-4E3},555)});

It slides individual elements off the page in random directions.  I specifically included span because of the syntax highlighting (each color has a separate span).
r = Math.random;
$('a,span,p').each(function () {
    var t = $(this);
    t.css({
        position: 'relative'
    });

    t.delay(r()*10000).animate({
        left: r() * 9e3 - 4e3,
        top: r() * 9e3 - 4e3
    }, 555);
});

It of course could be shortened by removing some of the tags, but let me know if there are any ways to shorten it without reducing the performance.

181 151 chars - 1 (explanation) - 10 (no jQuery) = 140 points
javascript:i=setInterval(function(){for(var a=document;0!==a.childNodes.length;)a=a.childNodes[a.childNodes.length-1];a!==document?a.parentNode.removeChild(a):clearInterval(i)},50);

A few more characters can be saved by omiting the function(){ and using a string instead.  Also note the extraction of commonly used properties, e.g., c='childNodes allows us to do z[c] instead of z.childNodes.
javascript:h=setInterval('d=z=document;c="childNodes";for(l="length";z[c][l];z=z[c][z[c][l]-1]);z!=d?z.parentNode.removeChild(z):clearInterval(h)',50);

I guess I could make less points by using jQuery and not traversing properties, but oh well.
Ungolfed:
var intervalHandle = setInterval(function() {
    var lastElement = document;
    //get last element
    while (lastElement.childNodes.length !== 0) {
        lastElement = lastElement.childNodes[lastElement.childNodes.length - 1];
    }

    if(lastElement !== document) {
        lastElement.parentNode.removeChild(lastElement);
    } else {
        clearInterval(intervalHandle);
    }
}, 50);

Basically this finds the latest DOM element on the page and removes it. Then keeps doing that for every 50 milliseconds, which I found to be a kind-of-average nice speed to see a page getting ripped from the ground up. It's therapeutic, I swear it.
Disclaimer: I had made this some time ago and decided to share it, since it seems appropriate here. The source is at my GitHub repository.

This is great! I edited it to include a more-golfed version that saves a few characters.  I hope you don't mind.  It's functionally identical.

@FakeRainBrigand Not at all, thanks! In fact, you helped me learn some new cool tricks, which was my original intention when writing it. Thanks again!

Javascript, 281
javascript:$('body').html().split('javascript:').forEach(function (a) {if (a.indexOf("location")*a.indexOf("write")*a.indexOf("noscript")==-1) try{exec(a.split("")[0].replace(/&#(\d+)/g, function(match, dec) {return String.fromCharCode(dec);}))} catch (e) {}});void 0;

It gets every response to the question in the form of javascript:(stuff) that doesn't change the location, and runs all of them.

Hmm... I can see lots of whitespace that appears to be removable. Perhaps you should remove it.

I am pretty sure this fails the rule: "no creating a script tag that pulls explosionThisPage.js or similar". Also, it doesn't work on every SO page, just this one. Also, it does real damage on questions asking about XSS, so you should add 9e72 to your score.

I like this effect. It basically toggles a slide effect for every div on the site every 1 millisecond.
javascript:setInterval(function(){$('div').toggle()},1)

Score
56
-1 Explanation
--------------
55 Total

Nice, but just toogle would work too:
`javascript:setInterval(function(){$('div').toggle(88)},1)`