Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Forget about it

Name: Anonymous 2009-04-02 12:30

I've read SICP, I became a Satori programmer. Yet, yesterday I asked my best friend of years to go out with her, and the answer was a direct no. We (used to) go out every week, tell eachother everything.

What the hell. I don't even feel like playing with dead dogs or whatever shit anymore. It's all pointless, /prog/.

Name: Anonymous 2009-04-04 3:51

>>13
import java.math.BigInteger;
public class LoveYou {
    private static String DEFAULTNAME = "Leah Culver";
    private static BigInteger TWO = new BigInteger("2");
    public static void main(String[] args) {
        String name = args.length==0?DEFAULTNAME:args[0];
        for(int i=0; i<name.length(); i++) {
            int digit = (int)(name.charAt(i));
            sum = sum.multiply(new BigInteger(digit+""));
        }
        System.out.println("Sum of name is: "+sum);
        sum = fibs(sum);
        System.out.println("Fibs is: "+sum);
        sum = fact(sum);
        System.out.println("Fact is: "+sum);
    }
    private static BigInteger fact(BigInteger n) {
        BigInteger counter = new BigInteger(n.subtract(BigInteger.ONE)+"");
        while(counter.compareTo(BigInteger.ONE)>0) {
            n = n.multiply(counter);
            counter = counter.subtract(BigInteger.ONE);
        }
        return n;
    }
    private static BigInteger fibs(BigInteger n) {
        BigInteger t = new BigInteger("0");
        BigInteger t2 = new BigInteger("1");
        BigInteger t3 = new BigInteger("2");
        BigInteger t4 = new BigInteger("0");
        while(t3.compareTo(n)<=0) {
            t4 = t.add(t2);
            t = t2;
            t2 = t4;
            t3 = t3.add(BigInteger.ONE);
        }
        return t2;
    }
}


Better get started.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List