Skip to main content

Home/ Web Programming/ Fibonacci Nightmare
Nancy Hall

Fibonacci Nightmare - 33 views

fibonacci

started by Nancy Hall on 13 Feb 09
  • Nancy Hall
     
    Oh, help!

    This Fibonacci stuff is messing with my head, and I'm sure it is because I don't really understand this PHP stuff. Even after looking up other people's code examples, I am still at a loss (and it still isn't working!).

    Can any kind-hearted person help me out? Or at least point me in the direction of some addition tutorials so that my head stops spinning?

    Anything would be appreciated!
  • Alex Halavais
     
    Hmmm. Lots of ways to do this. I'll start you out with one

    echo 0;
    echo "
    ";

    echo 1;
    echo "
    ";

    $x = 0;
    $y = 1;

    newnumber = $x + $y;

    echo $newnumber;
    echo "
    ";


    Now... what comes next? What needs to happen?
  • Alex Halavais
     
    Shoot, let's try that again. Diigo doesn't allow HTML :(.

    echo 0;
    echo "
    ";

    echo 1;
    echo ", ";

    $x = 0;
    $y = 1;


    newnumber = $x + $y;

    echo $newnumber;
    echo ", ";


    Now... what comes next? What needs to happen?
  • Nancy Hall
     
    I feel so silly.

    What I was doing the whole time was correct EXCEPT I didn't have "echo" - I had return. Now it's working fine.

    Oh, my!

    At least I know I wasn't totally wrong, and I get this stuff more than I initially though I did. I just need to pay closer attention to what words I use! Hahaha.

    I'll jazz it up before I send it out. Thank you so much, everyone!

    ~N~
  • Monica Aversa
     
    Thanks, Nancy!

    I am starting the Fibonacci challenge soon, so I may very well reference this thread if I get lost. Hope everything went well for you in the end!

    Best,

    Monica



    Nancy Hall wrote:
    > Oh, help!
    >
    > This Fibonacci stuff is messing with my head, and I'm sure it is because I don't really understand this PHP stuff. Even after looking up other people's code examples, I am still at a loss (and it still isn't working!).
    >
    > Can any kind-hearted person help me out? Or at least point me in the direction of some addition tutorials so that my head stops spinning?
    >
    > Anything would be appreciated!

To Top

Start a New Topic » « Back to the Web Programming group