Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
6 Correct haikus, add pronunciation
source | link
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 (07 ==!= 0)                               // while seven is not zero
            System.out.                              // System dot out dot

                    println(i + "!"                  // print line i plus not
                            + " has= a" value+ offactorial( " +   // plus is plus factorial
                            factorial(i++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.

class Factorial {
    public static void main(String[]
            command_line_run_args) {

        int i = 0;
        while (0 == 0) 
            System.out.

                    println(i + "!"
                            + " has a value of " +
                            factorial(i++));}

    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.

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.

5 Insert test program
source | link

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 , 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 {
    public static void main(String[]
            command_line_run_args) {

        int i = 0;
        while (0 == 0) 
            System.out.

                    println(i + "!"
                            + " has a value of " +
                            factorial(i++));}

    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.

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 , 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

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 , 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 {
    public static void main(String[]
            command_line_run_args) {

        int i = 0;
        while (0 == 0) 
            System.out.

                    println(i + "!"
                            + " has a value of " +
                            factorial(i++));}

    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.

4 added 135 characters in body
source | link

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 , 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

Java - 2 haikus

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

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

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 , 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

3 code formatting; there was too much whitespace
source | link
2 add haiku when pronounced
source | link
1
source | link