Follow me not!


Fibonacci

19 July 2007 11:01:38 WIB, under category PHP

Script berikut akan menggenerate deret Fibonacci.
[code] $a = 1;
$b =1;
while(1){
$c = $a+$b;
$a = $b;
$b = $c;
echo $c."\n";
}
?>[/code]

Mungkin cara saya salah.. Tapi who care? Selama outputnya masih fibonaci juga ha.ha.ha.. Ingat, script ini akan menggila saat dijalankan ^o^


12 Comments so far..

  1. uuuu
    19 July 2007, 13:13:04 WIB

    my supervisor, also your buddy (globe of mitha fm) wrote similar article about fractal image

  2. agung
    19 July 2007, 20:28:33 WIB

    wakakak.. pasti ada hubungannya sama posting sebelumnya

  3. Panda
    19 July 2007, 22:21:11 WIB

    better version

    Gitu aja kok repot :P

  4. Panda
    19 July 2007, 22:22:09 WIB

    <?php
    $a = 1;
    $b =1;
    while(1){
    $c = $a+$b;
    $a = $b;
    $b = $c;
    echo $c.”\n”;
    }
    ?>

    waduh blognya gak terjemahin < dan > nih

  5. rd Limosin
    19 July 2007, 22:29:33 WIB

    coba dulu aahhh…

  6. PriyayiSae
    20 July 2007, 01:27:18 WIB

    kopi paste dulu… trus cobain :d

  7. funkshit
    21 July 2007, 00:21:12 WIB

    while(1) sampe hang nich bakalan

  8. mufti
    21 July 2007, 02:58:55 WIB

    Hayo yang beranibener-bener coba? emang bignum php pol berapa? bisa ngitung 5000 faktorial nggak???? :D

  9. leo
    25 July 2007, 22:40:57 WIB

    koreksi kali ya mas,

    $a = 0;
    $b =1;

  10. sandal
    26 July 2007, 01:13:29 WIB

    @mufti
    benar mas, script saya di atas ga bisa sampe 500, mungkin bisa pake bc_math utk ngakalin.

    @leo
    he.he. tengkyuh ^_^

  11. devie
    26 July 2007, 04:05:14 WIB

    bukannya outputnya itu bakal kayak gini?
    2 3 5 ….
    bukan fibonacci dong? :-??

    CMIIW

  12. thevemo
    05 January 2008, 16:56:34 WIB

    Sandal, sandal komputer aja puyeng ngitungnya, apalagi manusia

RSS for comments TrackBack URL

Leave a comment or two

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>