text:
2D javascript table graphics
The challenge
Make a JavaScript program that can use a HTML table as a canvas, having each cell a pixel.
You can either input the position and color values in a form or by using the console.
Score calculation

+10 points for not using JQuery
+15 points for the cells scaling equally to keep the same table aspect ratio when the browser is scaled
+15 points for accomplishing the last thing without using any kind of CSS
+[number of upvotes]
+20 points if you do not label the cells' tags with coordinates (it counts if you make an JavaScript array like {"cell1-1": ..., "cell1-2": ..., "cell1-3": ...} but it doesn't count when you label the  tag itself, like  or )

So if you have 67 upvotes, no JQuery (+10), the cells scaling (+15) but by using CSS (no +15) and you do not label the cells (+20), then your score will be 67 + 10 + 15 + 0 + 20 = 112.
The challenge ends on 20 Feb 2014, 4:00 PM GMT+0.
WINNERS:
Doorknob -> 61 + 3 = 64 points
Victor, with 60 + 1 = 61 points
they have very close scores so I couldn't exclude Victor.

Be more clear about the do not label the cells with coordinates requirement. What is exactly considered a labeled cell? I think that adding something like id='cell4-8' or class='cell4-8' is labeling, but just adding them to a javascript object like {"cell1-1": ..., "cell1-2": ..., "cell1-3": ...} is ok. Am I right?

@Victor You are right. I'm changing the post now. Thanks!

Score: 61
10 (no jQuery) + 15 (scaling cells) + 15 (the scaling part uses no CSS) + 20 (no labels) + 1 (upvotes)
When you click on a cell, it turns the current color.
JavaScript
var w = h = 20, color = 'red'
function createTable() {
    var tbl = document.createElement('table')
    tbl.id = 'tbl'
    for (var i = 0; i < h; i++) {
        var tr = document.createElement('tr')
        for (var i2 = 0; i2 < w; i2++) {
            var td = document.createElement('td')
            td.addEventListener('mousedown', draw)
            tr.appendChild(td)
        }
        tbl.appendChild(tr)
    }
    document.body.appendChild(tbl)
    return tbl
}
function killTable(tbl) {
    tbl.parentNode.removeChild(tbl)
}
var tbl = createTable()

function draw(e) {
   e.preventDefault()
   this.style.backgroundColor = color
}

document.getElementById('finalize').addEventListener('click', finalize)
function finalize() {
    var tds = document.getElementsByTagName('td')
    for (var i = 0; i < tds.length; i++) {
        tds[i].style.border = 'none'
        tds[i].removeEventListener('mousedown', draw)
    }
    document.getElementById('optionsWrapper').style.display = 'none'
}

document.getElementById('changeColor').addEventListener('click', changeColor)
function changeColor() {
    color = document.getElementById('color').value
}

document.getElementById('changeDims').addEventListener('click', changeDims)
function changeDims() {
    var dims = document.getElementById('dims').value.split('x')
    w = +dims[0], h = +dims[1]

    killTable(tbl)
    tbl = createTable()
}

HTML

    <button id='finalize'>Finalize</button>

    Color: <input id='color' type='text' value='red' /><button id='changeColor'>Go</button>

    Change dimensions (WARNING: will erase drawing): <input id='dims' type='text' value='20x20' /><button id='changeDims'>Go</button>

CSS
td {
    width: 5px;
    height: 5px;
    padding: 0;
    border: 1px solid black;
}

table {
    border-collapse: collapse;
}

JSFiddle
http://jsfiddle.net/D9u2N/1/
Screenshots
Zoomed in view (while editing, click to enlarge to full size):

Finalized view (zoomed out):

Score: 60 + upvotes

No jQuery used.
No CSS.
The rule says [cells scaling equally to keep the same table aspect ratio when the browser is scaled], it does that by not scaling at all when the window is resized and if you do use scaling/zoom in the browser, it will keep the aspect ratio.
No cell or row labeling used.

The code basically creates a TableCanvas object. This object creates a table-based canvas and using javascript's DOM API, inserts it in a DOM node. Colors are specified as strings like "rgb(0,255,0)" for green.
It features:

Resizing without deleting the canvas contents (except for the pixels clipped out of the canvas in the operation).
Zooming (not to be confused with scaling).
Clearing area to a color.
Pixel manipulation.
Line, rectangle and ellipse drawing.
Extensible API to add your own methods.
Allows the creation of multiple independent instances at the same time in different parts of your DOM.

Fiddle
The actual code
function TableCanvas(target, pp) {
  var w = -1, h = -1, zoomH = 1, zoomV = 1, defaultColor = "rgb(255,255,255)";
  var rows = {};

  var tbl     = document.createElement("table");
  var tblBody = document.createElement("tbody");

  this.remake = function(p) {
    var newW = p.w ? p.w : w, newH = p.h ? p.h : h;
    if (newW < 0 || newH < 0) newW = newH = 0;
    if (p.zoomH) zoomH = p.zoomH >= 1 ? p.zoomH : 1;
    if (p.zoomV) zoomV = p.zoomV >= 1 ? p.zoomV : 1;
    if (p.defaultColor) defaultColor = p.defaultColor;

    for (var j = 0; j < newH; j++) {
      var isNewRow = j >= h;

      if (isNewRow) {
        var tr = document.createElement("tr");
        rows[j] = {tr: tr, cells: {}};
        tblBody.appendChild(tr);
      }

      for (var i = 0; i < newW; i++) {
        var isNewCell = isNewRow || i >= w;

        if (isNewCell) {
          var td = document.createElement("td");
          td.style.background = defaultColor ? defaultColor : "rgb(255,255,255)";
          rows[j].cells[i] = {td: td};
          rows[j].tr.appendChild(td);
        }
        rows[j].cells[i].td.style.paddingLeft = (zoomH - 1) + "px";
        rows[j].cells[i].td.style.paddingTop = (zoomV - 1) + "px";
      }
    }

    for (var j = h - 1; j >= 0; j--) {
      for (var i = w - 1; i >= newW; i--) {
        rows[j].tr.removeChild(rows[j].cells[i].td);
        delete rows[j].cells[i];
      }
      if (j >= newH) {
        tblBody.removeChild(rows[j].tr);
        delete rows[j];
      }
    }

    w = newW;
    h = newH;
    return this;
  };

  tbl.appendChild(tblBody);
  target.appendChild(tbl);
  tbl.setAttribute("border", "0");
  tbl.style.borderSpacing = "0";

  this.getTd = function(p) {
    return (p.x >= 0 && p.y >= 0 && p.x < w && p.y < h) ? rows[p.y].cells[p.x].td : null;
  };

  this.getPixelColor = function(p) {
    return (p.x >= 0 && p.y >= 0 && p.x < w && p.y < h) ? rows[p.y].cells[p.x].td.style.background : null;
  };

  this.setPixelColor = function(p) {
    if (p.x >= 0 && p.y >= 0 && p.x < w && p.y < h) {
      rows[p.y].cells[p.x].td.style.background = p.color ? p.color : defaultColor ? defaultColor : "rgb(255,255,255)";
    }
    return this;
  };

  this.drawRectangle = function(p) {
    for (var a = Math.min(p.x1, p.x2); a <= Math.max(p.x1, p.x2); a++) {
      for (var b = Math.min(p.y1, p.y2); b <= Math.max(p.y1, p.y2); b++) {
        this.setPixelColor({x: a, y: b, color: p.color});
      }
    }
    return this;
  };

  this.drawLine = function(p) {
    var t, x1 = p.x1, x2 = p.x2, y1 = p.y1, y2 = p.y2;
    if (Math.abs(x2 - x1) > Math.abs(y2 - y1)) {
      if (x1 > x2) { t = x1; x1 = x2; x2 = t; t = y1; y1 = y2; y2 = t; }
      for (var a = x1; a <= x2; a++) {
        this.setPixelColor({y: y1 + (y1 === y2 ? 0 : Math.floor((a - x1) * (y2 - y1) / (x2 - x1))), x: a, color: p.color});
      }
    } else {
      if (y1 > y2) { t = x1; x1 = x2; x2 = t; t = y1; y1 = y2; y2 = t; }
      for (var a = y1; a <= y2; a++) {
        this.setPixelColor({x: x1 + (x1 === x2 ? 0 : Math.floor((a - y1) * (x2 - x1) / (y2 - y1))), y: a, color: p.color});
      }
    }
    return this;
  };

  this.drawEllipse = function(p) {
    var t, x1 = p.x1, x2 = p.x2, y1 = p.y1, y2 = p.y2;
    if (x1 > x2) { t = x1; x1 = x2; x2 = t; }
    if (y1 > y2) { t = y1; y1 = y2; y2 = t; }
    var rx = (x2 - x1 + 1) / 2, ry = (y2 - y1 + 1) / 2, cx = (x2 + x1) / 2, cy = (y2 + y1) / 2;
    for (var a = x1; a <= x2; a++) {
      for (var b = y1; b <= y2; b++) {
        if ((a - cx) * (a - cx) / (rx * rx) + (b - cy) * (b - cy) / (ry * ry) <= 1) this.setPixelColor({x: a, y: b, color: p.color});
      }
    }
    return this;
  };

  this.clear = function(c) {
    this.drawRectangle({x1: 0, y1: 0, x2: w - 1, y2: h - 1, color: c});
    return this;
  };

  this.getWidth = function() { return w; };
  this.getHeight = function() { return h; };
  this.remake(pp);
}

The test code
var body = document.getElementsByTagName("body")[0];
var divA = document.createElement("div"), divB = document.createElement("div");
body.appendChild(divA);
body.appendChild(divB);
divA.style.cssFloat = "left";
divA.style.marginRight = "10px";
divB.style.cssFloat = "left";
var canvas, canvas2, i = 0, f, commands = [
  function() {
    console.log("Create a magenta canvas");
    canvas = new TableCanvas({target: divA, w: 50, h: 50, defaultColor: "rgb(255,0,255)"});
  },
  function() { console.log("Draw black pixel"); canvas.setPixelColor({x: 2, y: 2, color: "rgb(0,0,0)"}); },
  function() { console.log("Zoom 10x horizontal, 5x vertical"); canvas.remake({zoomH: 10, zoomV: 5}); },
  function() { console.log("Draw green pixel"); canvas.setPixelColor({x: 9, y: 16, color: "rgb(0,255,0)"}); },
  function() { console.log("Zoom to 3x"); canvas.remake({zoomH: 3, zoomV: 3}); },
  function() { console.log("Paint as yellow"); canvas.clear("rgb(255,255,0)"); },
  function() { console.log("Draw second green pixel"); canvas.setPixelColor({x: 29, y: 36, color: "rgb(0,192,0)"}); },
  function() { console.log("Resize 1"); canvas.remake({w: 50, h: 60, defaultColor: "rgb(0,0,255)"}); },
  function() { console.log("Resize 2"); canvas.remake({w: 60, h: 45}); },
  function() { console.log("Resize 3"); canvas.remake({w: 45, h: 50, defaultColor: "rgb(255,0,0)"}); },
  function() { console.log("Resize 4"); canvas.remake({w: 60, h: 60}); },
  function() {
    console.log("Create a green second canvas");
    canvas2 = new TableCanvas({target: divB, w: 50, h: 50, defaultColor: "rgb(0,255,0)"});
  },
  function() {
    console.log("Draw smiley");
    canvas2.drawEllipse({x1: 1, y1: 1, x2: 48, y2: 48, color: "rgb(255,255,0)"})
           .drawEllipse({x1: 10, y1: 10, x2: 20, y2: 20, color: "rgb(0,0,0)"})
           .drawEllipse({x1: 30, y1: 10, x2: 40, y2: 20, color: "rgb(0,0,0)"})
           .drawLine({x1: 10, y1: 30, x2: 15, y2: 35, color: "rgb(0,0,0)"})
           .drawLine({x1: 15, y1: 35, x2: 35, y2: 35, color: "rgb(0,0,0)"})
           .drawLine({x1: 35, y1: 35, x2: 40, y2: 30, color: "rgb(0,0,0)"});
  },
  function() { console.log("Draw cyan rectangle"); canvas.drawRectangle({x1: 10, y1: 10, x2: 45, y2: 45, color: "rgb(0,255,255)"}); },
  function() { console.log("Draw orange ellipse"); canvas.drawEllipse({x1: 28, y1: 14, x2: 38, y2: 49, color: "rgb(255,128,0)"}); },
  function() { console.log("Draw blue line"); canvas.drawLine({x1: 12, x2: 20, y1: 40, y2: 5, color: "rgb(0,128,255)"}); },
  function() { console.log("Zoom to 4x"); canvas2.remake({zoomH: 4, zoomV: 4, h: 80}); },
  function() { console.log("Draw black line"); canvas.drawLine({x1: 4, y1: -9, x2: 32, y2: 60, color: "rgb(0,0,0)"}); },
  function() { console.log("Zoom to 2x3"); canvas2.remake({zoomV: 3}); },
  function() { console.log("Zoom to 1x"); canvas2.remake({zoomH: 1, zoomV: 1}); },
  function() {}
];
f = function() {
  (commands[i])();
  i++;
  if (i < commands.length) setTimeout(f, 400);
};
f();


text:
Factorial in haiku!
Task
Create a program that calculates the factorial of a number using no built-in factorial functions. Easy? The catch is that you must write your entire program (including testing it) in haiku form.

You can use as many haikus as you need, but when pronounced, they must follow the 5-7-5 syllable format.
Scoring
This is a popularity-contest, so you must get the most upvotes to win. Your program must consist of at least one full haiku, and all haikus must be complete.
When reading code, the first line of each haiku will have 5 syllables, the second will have 7, and the third will have 5.

Sounds like a perfect fit for something written in Shakespeare: http://shakespearelang.sourceforge.net/report/shakespeare/shakespeare.html

It seems most answers are ignoring "including testing it".

I like how you link to a site that correctly says the important thing for Haiku are (a) kiru and (b) a seasonal reference and then only ask for the more or less optional part of counting mora (or syllables in a language that doesn’t really have mora.

I agree with @ChristopherCreutzig -- it would be much more interesting if we had to ensure a seasonal reference and cutting. Sadly, we often overlook these fundamentals of haiku. Seems to me that then or punctuation could aid in cutting. For kigo, not so sure...

I am no expert to Haikus, but there is certainly some lyrical quality expected. So far I only see one answer that has any.

String[] myWords = { "some words",\n"seven syllables here",\n"another five here"}; (I should use morae, but some words can't be split, thus I use syllables.)

@SebastianH /about your comment:/lyrical quality - Perl?/That must be a first!/

IK it's quite late, but I hope you guys know there is an OS called Haiku? Code for it would fit here perfectly. Actually, most C++ programs are compatible with it...

Smalltalk
(evaluate in a workspace; opens a dialog, asks for a number and prints the result on stdout):
"in" "this" 'poem,' "you" "must"
"pronounce" "characters" "like" "these:"
"return(^)," "and" "times(*);" "please".

"but" 'never' "in" "here"
"tell" "anyone" "about" "those"
"few" "parentheses".

"otherwise" "these" "words"
"are" "stupid" "and" "this" "coded"
"rhyme" "is" "wasted" Time.

"let" "us" "now" "begin"
"by" "defining," "in" Object
"and" compile: "the" "rhyme:"

'fac: "with" arg"ument"
"to" "compare" arg <"against" 2 ">"
"and" ifTrue: [ ^"return"

"["1] "or" ifFalse: "then"
["return"^ arg *"times" "the" "result"
"of" ("my"self ")getting"

"the" fac:"torial"
"of" "the" "number" arg "minus"-
1 "[(yes," "its" "easy")]'.

("Let" "me" "my"self "ask"
"for" "a" "number," "to" "compute"
"the" fac:"torial"

("by" "opening" "a"
"nice" Dialog "which" "sends" "a"
request: "asking" "for"

'the Number to use'
"(which" "is" "(" "treated" ) asNumber)
"then" print "the" "result".

I tried to bring in some reflection ("in this poem") and kigo as well.
Also, some western style rhyme elements are included (please->these, time->rhyme); however, being neither native speaker of Japanese, nor of English, forgive any stylistic details ;-)

BTW: To try in Squeak/Pharo, replace "Dialog" by "FillInTheBlankMorph" and "print" by "inspect".

Java - 2 haikus
protected static
        int factorial(int n) {
    if (n == 0) {
        return n + 1;
    } return factorial(n
            - 1) * n;}

Even when the question isn't code-golf, I often catch myself golfing the answer. In this case, I golfed the number of haikus.
I pronounce it so:

protected static
int factorial int n
if n is zero
return n plus one
return factorial n
minus one times n

Test program:
class Factorial {                                    // class Factorial
    public static void main(String[]                 // public static void main string
            command_line_run_args) {                 // command line run args

        int i = 0;                                   // int i is zero
        while (7 != 0)                               // while seven is not zero
            System.out.                              // System dot out dot

                    println(i + "!"                  // print line i plus not
                            + " = " + factorial(     // plus is plus factorial
                            i += 1));}               // i plus equals 1

    protected static
            int factorial(int n) {
        if (n == 0) {
            return n + 1;
        } return factorial(n
                - 1) * n;}}

Note that this program starts outputting 0s fast; that is a result of overflow. You could easily get larger correct numbers by changing each int to long.
Standard pronunciations for System.out.println and public static void main(String[] args) are reflected in the program.

Sorry for the unupvote; I want to boost the Haskell solution

Haskell
fact :: Int -> Int          -- fact is Int to Int
fact x = product (range x)  -- fact x is product range x
range x = [1..x]            -- range x is 1 [pause] x

Haskell education time:

The range x function creates a list of integers from 1 up to the value of x.
The fact x function multiplies all the values of the list range x together to compute the result.
The first line says that the fact function takes an integer and returns an integer.

Umm... Int is limited to 32 bits or so. Surely you don't want to use Integer?

missing the point somewhat @JanDvorak?

No. I realise they amount to a different amount of syllables and thus a drop-in replacement isn't possible. What I'm asking for is a Haskell entry that doesn't overflow :-) (and yes, I like even this one)

Form over function. If this were real programming I would certainly account for the overflow case :)

range x is 1 to x is 6 syllables though

Oh jeez! I can't believe I didn't notice (and apparently neither did 22 other people).

@David I read it as "range x is one [dramatic pause] x".

Honestly, that's how I read it in my head and that's why I didn't notice!

Good lord. It's a single haiku and it's elegant. I have got to learn Haskell.

I highly recommend Learn You a Haskell if you'd like to learn you a Haskell.

APL
factorial←{×/⍳⍵}

Factorial is—
  the product of naturals
  up to omega

+1 for the <- functioning as a kireji, whether you knew that was what you were doing or not.

@JonathanVanMatre LOL not even a clue! I did use a dictionary to count the syllables though (not a native speaker.) I added a dash to show the kireji.

+1 for also being both simple and euphonious in English.

Simple, yet beautiful.

Save a three bytes: factorial←×/⍳ "up to the input".

 Shakespeare
The Products of Love:
A haiku tragedy with
mathy undertones.

Romeo, a man.
Juliet, a maiden fair.
Friar John, a monk.

Act I: A Cycle.
Scene I: Pertinent Values.
[Enter Romeo]

[Enter Friar John]
Romeo: Listen to thy
heart. Thou art thyself.

Friar John: Thou art
as forthright as a songbird.
[Exit Friar John]

[Enter Juliet]
Romeo: Thou art as fair
as a violet.

Scene II: Questioning
Themselves. [Exit Juliet]
[Enter Friar John]

Friar John: Art thou
as just as the sum of me
and a nobleman?

Romeo: If so,
let us proceed to scene III.
[Exit Friar John]

[Enter Juliet]
Romeo: Thou art as good
as the product of

thyself and myself.
Juliet: Thou art as fierce
as the sum of an

eagle and thyself.
We must return to scene II.
Scene III: A Lengthy

Title for a Brief
Dénouement; Or, The Last Word.
[Exit Friar John]

[Enter Juliet]
Romeo: Open your heart.
[Exit Romeo]

An (imagined) test case:
Despite its length, this program just takes a single integer as input and provides a single integer as output. So:
6 ↵ 720
7 ↵ 5040
0 ↵ 1    1 ↵ 1

("Six, seven-twenty. / Seven, five thousand forty. / Zero, one. One, one.")

I'm not sure how I feel about the fact that I can tell this is legit code.

Python 2, 4 Haikus
A complete Python 2 program haifac.py. Run as python haifac.py <n>
#run this full program
import operator as\
op; import sys#tem

#please provide an arg
n = sys.argv[1]
def haifac (n):

    if n < 1:
        return 1#to me at once
    else:#do something else

        return op.mul(
            n, haifac(n - 1))
print haifac(int(n))

Pronounciation:

run this full program
import operator as
op import system
please provide an arg
n equals sys arg v 1
define hai fac n
if n less than 1
return 1 to me at once
else do something else
return op dot mul
n hai fac n minus 1
print hai fac int n

I like the use of #to me at once to make the meter work...

And me likes the escaped newline in the beginning :)

I think using comments is kind of like cheating.

GolfScript, 2 Haikus
),{0>},{,,*}*

Read as haiku, enumerating each keystroke:
#close parenthesis
#comma open-brace zero
#greater-than close-brace

#comma open-brace
#comma comma asterisk
#close-brace asterisk

With test case (5 haikus):
[1 2 3]4+          #generate the array [1 2 3 4]
{                  #start creating block
),{0>},{,,*}*      #actual factorial code
}%                 #close block and map across array (so that we should have [1! 2! 3! 4!])
[1 2 6]2.3**12++=  #generate the array [1 2 6 24] and check for equality

Read as haiku:
#open-bracket one
#space two space three close-bracket
#four plus open-brace

#close parenthesis
#comma open-brace zero
#greater-than close-brace

#comma open-brace
#comma comma asterisk
#close-brace asterisk

#close-brace percent-sign
#open-bracket one space two
#space six close-bracket

#two period three
#asterisk asterisk one
#two plus plus equals

Whitespace
This makes uses of one of the most famous haikus, and a great deal has been written about it.
No idea why nobody has done this before, it doesn't even take any effort!
First of all, before reading the poem, I want you to lean back, relax, and enjoy the tranquility created by the great void surrounding the poem. It emphasizes the pond, surrounded by a vast landscape.

古池や
蛙飛びこむ
水の音

source code on filebin
In case you do not speak Japanese, this is pronounced as follows:

fu ru i ke ya
ka wa zu to bi ko mu
mi zu no o to

Naturally, it is counted by morae. The kireji is や (ya), the kigo (seasonal reference) is 蛙 (kawazu, frog, -> spring).
Using the linux interpreter from the official page, you can use it like this:

$ echo 5 | ./wspace .ws

PHP, 4 haikus
All-in-rhyme haikus!
function haiku($can) { // function haiku can (5)
    if ($can == 1) // if can is equal to one (7)
        return ++$stun; // return increase stun (5)

    if ($can == 0) { // if can equals ou (5)
        echo "It is one, you know! "; //echo "It is one, you know! " (7)
        return 1+$blow; } //return one plus blow (5)

    if ($can > $fun) { //if can exceeds fun (5)
        return haiku($can-1) //return haiku can less one (7)
            *$can; }} //multiplied by can (5)

if (null == $knee) { // if null equals knee (5)
    $free=0+3; // free equals zero plus three (7)
    echo haiku($free); } // echo haiku free (5)

I read line three return plus plus stun.

I really like this one.

Forth
: fugu 1              \ colon fugu one                = 5
swap 1 + 1 ?do        \ swap one plus one question do = 7
i * loop ;            \ eye star loop semi            = 5

Fugu is the function and my attempt at kigo: blowfish is a winter reference.  I intend ?do to be kireji, the turning point, before the counted loop.

Mathematica
f[x_]:=     (* f of x defined *)
 x f[x-1]   (* x times f of x less 1 *)
f[1]=1      (* Mogami River *)

Pedants may read the last line as "f of 1 is 1", but I couldn't resist the shout-out to Basho.
Testing:
Table[f[n],     (* Table f of n *)
 {n, 1, 10, 1}] (* n from 1 to 10 by 1 *)
ListLogPlot[%]  (* ListLogPlot output *)

Returning:
(1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800)

Linguistic Distinctiveness Bonus Haiku (inspired by @cormullion)
Rewrite any term
High-level functions abound —
Mathematica

Batch
@set /a t=1 &^
for /L %%a in (2, 1, %1) ^
do @set /a t*=%%a

Pronunciation; ignores mathematical expressions as well as these symbols @ / % ^ , ( ):

set a t 1 and for L a in 2 1 1 do set a t a

Note; this calculates the factorial, it doesn't output it - the variable t contains the factorial.
The following Haiku / code can be appended to the same batch file to output the factorial (the |'s are pronounced as pipe):
@echo %t% ||^
When will you learn, unclemeat ^
Why must you use Batch?

Clojure
(->> *command-line-args*                ; thrush com-mand line args
  seq last read-string range (map inc)  ; seq last read string range map inc
  (reduce *) println)                   ; re-duce times print-lin

newLISP
The parentheses are not pronounced:
(define (fac n (so))            ; define fac n so
(if (= n 0) 1                   ; if equals n zero 1
(* n (fac (dec n)))))           ; times n fac dec n

(for (n 0 10)                   ; for n zero ten
; let's test from zero to ten
(println (fac n thus)))         ; printline fac n thus

Lisp code consists of
numerous parentheses
and a few functions

Love the commentary haiku. Taking it as inspiration and adding one to my answer.

F#
let fact n =
    [1..n] |>
    Seq.fold (*) 1

let fact of n be
    from one up to n, apply
    Seq dot fold star one

stole mine... ;)

LiveScript
This one's medieval:
prelude = ^^ do                       # prelude is clone do
  require \prelude-ls                 # require prelude dash ls
{ product } = prelude                 # product is prelude

story = (ah) ->                       # story is ah such:
  ones-misery = (one) ->              # one's misery is one such
    let death = product               # let death be product

      fight = [1 to one]              # fight is one to one
      why = (one) -> death <| fight   # why is one such death take fight
  ones-misery ah                      # one's misery ah

room = console.log                    # room is console log
room <| (story 10)!                   # room take story three bang
[null of { use : this }]              # no of use is this

Prints 3628800, which is 10!. It's a little roundabout: The function story returns a function ones-misery, which always returns the answer. It's artsier that way.
No filler comments or unnecessary strings!

Bonus debugging story:

I burst out laughing
  when informed that a bug was
  "death is undefined"

Haha, you wouldn't have hit that bug if you had "death = !proud".  http://www.poetryfoundation.org/poem/173363

Haskell
This one will be a rhyming haiku!

fact 0=1                     --fact zero is one
fact ton=ton * (fact stun)   --fact ton is ton times fact stun
        where stun=pred ton  --where stun is pred ton

Yeah!
Note: Pred means the previous number. Also in haskell, you can have multiple definitions of a function, and the first one that makes sense is used.

Elegant! (filler)

Ruby - One Haiku
ARGV.first.to_i.
 tap do |please| puts 1.upto(
 please ).inject( :*) end

Read (ignoring punctuation, but including one emoticon) like this:
 arg vee first to i
   tap do please puts one up to
 please inject smile end

Produces no output for 0!.

@200_success: Thanks. I may have to live with that, it's not strictly in the requirements, so I will have a think

Also the test is meant to be haiku. I missed that on my first read myself.

@Jonathan Van Matre: Yes I missed it too. Seems even the top answers are not bothering with this. As mine is on the command line, it is tricky to get multi-lines, I guess I should remove the test for now to make it a canonically ok answer though . . .

In SML:
fun fact 0 = 1
  | fact n = n*fact(n-1)
  ;

read as:
"fun fact 0 is one,
bar that, fact n is n times
fact of n less one"

Perl
$r = 1; for(1           # r gets one for one
.. pop @ARGV) { $r *=   # to pop arg v r splat gets
$_; } print $r;         # the default print r

Toss this into a file named f.pl
And the output:

$ perl f.pl 3
6$ perl f.pl 1-1
1$ perl f.pl 10
3628800$

Which is read as:

perl f p l three
perl f p l one less one
perl f p l ten

How do you pronounce the testing in 7-5-7?

@ChristopherCreutzig I can get 5 and 6 in there nicely for testing ('perl f p l three' (5) and 'perl f p l ze-ro' (6))... I can't quite figure out a clean 7 one that shows the necessary tests.

@ChristopherCreutzig Figured out a trick for it.  Thank you for reminding me of that requirement.  (Though, to be fair, 1-1 doesn't actually test '0', just gives the same result - it works for zero too though)

Perl
I know it's against the rules to use ready-made functions, but here's what I get.
Imagine your task is to instruct an over-sized rodent:
use Math::BigRat; use
feature 'say'; use warnings; say
new Math::BigRat($_)->bfac

I can only guess what the last word means and how it's pronounced, but I assure you it is one syllable. Apparently he doesn't understand what you want from him, so you have to elaborate (easing on quality standards as you loose patience):
use Math::BaseConvert
':all'; no strict subs; no warnings;
reset and say fact($_)

still to no avail. Then you have to explain it in plain English:
no strict; no warnings;
use Math::Combinatorics;
say factorial($_)

What happened next I don't know, but code is valid:
perl -nE 'use Math::BigRat; use feature "say"; use warnings; say new Math::BigRat($_)->bfac'
42
1405006117752879898543142606244511569936384000000000

and
perl -nE 'use Math::BaseConvert ":all"; no strict subs; no warnings; reset and say fact($_)'
33
8683317618811886495518194401280000000

and
perl -nE 'no strict; no warnings; use Math::Combinatorics; say factorial($_)'
16
20922789888000

"I assure you it is one syllable" :)

Too bad you can't toss a Coy error in there.

This is the only answer so far that has any lyrical quality :)

@SebastianH, thanks :), though I cheated while others tried to play by the rules

Python
lambda n: reduce(
    lambda a, b: a * b,
    range(1, n), n)

The way I read it:

lambda n: reduce
lambda a b: a times b
range 1 to n, n

`

Produces buggy output for 0!.

C
#include <std\
io.h>
#include \
<stdlib.h>

int main(int argc
 , char** argv)
{   // iteratively
    // compute factorial here
long int n = \
0, i \
= 0, r = \
1 /*
product starts at one*/;

if (argc
> 1) { n =
strtol(argv[\
1], NULL, 10)
; if (n
< 0) {
       printf("Arg must\
       be >= 0\n");
       exit(-
    1);}
} i =
n;
while (i) { r
= r * i;
    i
--;
} /* print
the result*/ printf(
"%d factorial\
equals %d\
\n", n
, r);
/*done*/}

Pronounciation:
pound include standard
I/O dot h pound include
standard lib dot h
int main int arg c
comma char star star arg v
open brace comment
iteratively
compute factorial here
long int n equals
zero comma i
equals zero comma r
equals one comment
product starts at one
semicolon if arg c
is greater than one
open brace n is
str-to-l of arg v sub
one comma NULL comma ten
semicolon if
n less than zero begin
printf arg must
be greater than or
equal to zero backslash
n semicolon
exit negative
one semicolon end brace
end brace i equals
n semicolon
while i open brace r
equals r times i
semicolon i
decrement semicolon
close brace comment print
the result printf
percent d factorial
equals percent d
whack n comma n
comma r semicolon
comment done end brace

The # character is typically pronounced sharp or octothorpe in C code.

Python
Uses  a single haiku to do the job!
f = lambda x:   \ #  f is lambda x:
    0**x or x * \ #    zero pow x, or x times
    f(x-1)        #    f(x minus 1)

This defines a recursive lambda which calculates the factorial - 0**x handles the case of 0 as it evaluates to 1.

Are we allowed to use filler?
Python 2 haikus:
number = num + 1
a = 13 + 4
b = 14

nuum = len([1])
for i in range(1, number):
    nuum *= i

nuum equals length one?

length of the list

I'm asking for your pronunciation of the first line. num equals length of the list makes 7 syllabes instead of 5.

You could replace nuum with foo (because I'm reading if as nu-um, which puts you over the limit.)

C# - 3 haikus
I removed the usual C# using, namespace and class definition clutter, which would be a 4th haiku.
public static void
Main(){int num = Convert.
ToInt32

(Console.ReadLine());
 Console.WriteLine(num ==
 0 ? 1 :

Enumerable.
Range(1, num).Aggregate
((i, j) => i * j));}

which I read as
public static void
Main int num equals Convert
To int thirty-two

Console dot Read line
Console Write line num equals
zero? then one, else

Enumerable
Range 1 to num aggregate
i j i times j

Haskell
module Haiku where          -- read literally.
fac x = let in do           -- = is read as 'equals'
product [1..x]              -- product one to x

note that the module .. where is added automatically to any Haskell code without it at compilation, so not writing it is practically cheating.

Until today I had no idea you could enter a single statement under do and it didn't have to be Monad a => a.

C
Least beautiful haiku ever.
int main(int argc,
char *argv[]){int in,out;
sscanf(argv

[1],"%d",
&in);out=1;while
(in >

1){out*=
in--;}printf(
"%d",out);}//done

/*
Int main, int argc,
char star argv. Int in out.
Sscanf argv

sub one, percent d,
and in. Out equals one. While
in is greater than

one, out times equals
in minus minus. Printf
percent d out. Done
*/

How do you pronounce char *argv[]){int in,out; to have it 7 syllables? I count 5-6, depending on pronounciation of argv...

as in the comments:  'char star arg-v. int in out'

Erm... totally missed the comments, was used to have them right to the code by the other answers :D Nevermind.

JAVA:
In response to the question and to the Dwaiku (Double-Haiku or whatever you wanna call it) posted by Quincunx in Java, here's the correct Haiku:
public static int factorial(int n) {
   return (n==0) ? (n+1) : (factorial(n-1) * n);
}

Javascript - Two Haikus
function factor (a) {          // function factor a
  if(!a){ return 1 ||          // if not a return 1 or
    a & 17}                    // a and seventeen

  else if (a + 1){             // else if a plus one
    return a * factor          // return a into factor
    (a + ( - 1) )  }}          // a plus minus one

I am not a native speaker. So, I used a dictionary to count the syllables. Hopefully, it's good enough. Any feedback is welcome :)

Powershell, 2 Haikus
function facto ($num){    # function facto num
$i = 1; 1..$num|          # i equals one; i to num
foreach { $i =            # for each i equals

$i * $_}; write $i}       # i times this write i
$answer = facto $args[    # answer equals facto args
0]; write $answer         # zero write answer

Befunge-93
Three haikus:
0&>:v
-:|:>1>
v#>$\
>:>>v
>$.@v<<
^#v*_
#>>>v
<<:\<>^
<#<#<

Last line is admittedly kind of cheaty.
Try here: http://www.bedroomlan.org/tools/befunge-93-playground

Perl - 3 Haikus
This one useds some clever formatting and pronunciations - it also disregards symbols.
print "Enter number: ";
chomp(my $num = <STDIN>);
$result = 1;
for $x (1..$num) {
  $new = $x * $result;
  $result = $new;
}
if (1) { print "$result\n .
Is the factorial of\n";
if ($result) { print "$num"; }

Haiku:

Print: En-ter num-ber
     Chomp: my num e-quals STD (stand)-IN
     Re-sult e-quals one
     For x one to num (or 'one range num')
     New e-quals x times re-sult
     re-sult e-quals new
     If one: print re-sult
     Is the fac-to-ri-al of
     If re-sult: print num

Let me know if I messed up anywhere.

Mathematica - One Haiku (+1 extra (2 counting title))
factorial[n_]
 := Product @@
  Range[1, n]

fac-tor-i-al en
set de-layed pro-duct ap-ply
range from one to en

From some simple words
Complex functions can arise
Mathematica

C (GCC), 4 haikus

int fac(int number) { // int fac int number
        if (number == 0) { // if number equals zero
                puts("Done."); return 1; // puts done return one
        }

        else return number // else return number
                * fac(number - 1); // times fac number minus one
        puts("Unreachable"); // puts unreachable
}

main(argc, argv) // main arg-c arg-v
        char ** argv; { // char pointer pointer arg-v
        char c = getchar(); // char c is getchar

        printf("%" // print-f ampersand
                "d", fac(c - '0')); // d fac c minus zero
        return +0; // return plus zero
}

Try It Online!

Python 2
print(reduce(lambda              # print reduce lambda
    a,b: a * b, range(1,         # a b a times b range one
        1 + input()), 1))        # one plus input, one

When input is 0, TypeError: reduce() of empty sequence with no initial value

@200_success: 0! = 1 is just a convention ;)

Now it works, but the last line has six syllables.

Clojure
(defn fact [n] (if                  # def-fun fact n if
  (zero? n) 1                       # zero question mark n 1
  (* n (fact (dec n)))))            # times n fact dec n

Python - Two Haikus
val = int(input())        -> val is int(input())
for hi in range(1,n):   -> for hi in range one to n
    val *= hi           -> val is val times hi

# Still a cool haiku    -> Just read it
print(n)                -> print val in parentheses
# Completed haiku       -> Just read it

Try it online!

source: Stack Exchange

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

authors: Ахмад Цугаев

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

sort: votes