Thread: I've exhausted all efforts...

  1. #1
    Disagreeably Disagreeable
    Join Date
    Aug 2001
    Posts
    711

    Unhappy I've exhausted all efforts...

    Can someone please help me figure out what is going on with this code?

    http://www.flashdaddee.com/forums/sh...&threadid=4492

    I hate asking people for help in my own code, and what's more I hate having to ask people to "find" my bug. I'm sorry, but I just can't think of any reasons why it's doing what it's doing.

    P.S. If you're not a member of FD, and don't plan on being one anytime soon (yet you can help me), just PM me here or just reply to this thread.

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    I'll have a look at it after my movie. Until then, good luck HB.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  3. #3
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    >>The final while loop is better written as
    Doh! Are we answering over here or over there?!

    Goddam cross-site-cross-posting
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  4. #4
    Disagreeably Disagreeable
    Join Date
    Aug 2001
    Posts
    711
    >This bit is wrong<

    Yes, Hammer pointed that out to me over at FD. I feel so retarded for not reassigning the count variable.

    Anyway, thanks a lot for all that helped. And thanks for those who were going to help.

    *walks away in shame*

    >The final while loop is better written as<

    Besides being more compact (and obviously a bit faster), is there any other positives to using that form? I didn't think there was, and since I'm a pedantic little bastard that loves things spelled out, I opted for the longer route.

    >Goddam cross-site-cross-posting<

    Heh, well I wouldn't have ever even brought it up over here, but I had the thread at FD for like 2 days and no replies. Sorry for wasting space, guys.
    Last edited by Hillbillie; 11-15-2002 at 06:04 PM.

  5. #5
    Disagreeably Disagreeable
    Join Date
    Aug 2001
    Posts
    711
    >Not that it matters in your current code - my count is accurate, and yours is off-by-one when the loop finally ends.<

    Are you sure about that?? The code works fine. I even did a memory dump of the video memory to inspect. If you're sure, please, if you would, explain how mine is off by one.

    >Your code does two comparisions to my one comparison for each loop iteration.<

    True. I saw that after I posted. And I'm too damned lazy (and sleepy) to correct myself. I had saw the difference as you simply putting the increment in the array index instead of outside of the if(). (In other words, I didn't notice you did away with the if() altogether.) Maybe I should get some rest now. Yeah, I should definitely get some sleep...

  6. #6
    Disagreeably Disagreeable
    Join Date
    Aug 2001
    Posts
    711
    Okay, will do.

    Thanks a lot Salem!

Popular pages Recent additions subscribe to a feed