Your move, gee.

Your move, gee.

Homeless People Are Sexy Shirt $21.68

Unattended Children Pitbull Club Shirt $21.68

Homeless People Are Sexy Shirt $21.68

  1. 2 months ago
    Anonymous

    No, we've all seen this thread countless times.

    • 2 months ago
      Anonymous

      How many years has this been going on anyway? I must have seen dozens of threads and images of "look at the pants-on-head moronic code this guy writes"

      • 2 months ago
        Anonymous

        /g/tards look at this and laugh at him for writing this kind of code but they themselves have never been doing complex projects beyond tic tac toe or le ebin calculator app

        • 2 months ago
          Anonymous

          projectin' much huh?

      • 2 months ago
        Anonymous

        I'm laughing my ass here but I wouldn't know how to make different. Anybody here with experience to explain my dumb ass?

        • 2 months ago
          Anonymous

          there is no generic answer but firstly I can see some AND and OR statements that could be optimized, also he should group them with parenthesis to make it easier to read, I would also definitely add some comment about the actual game state for each AND statements for my future self.

          • 2 months ago
            Anonymous

            how can so many people get baited by OP's pic?

            then you don't really have anything to say

            switch?

            behold the calibre of IQfy

          • 2 months ago
            Anonymous

            >then you don't really have anything to say
            prove me wrong then, so many of these statements can be simplified, that's a fact.
            yandere is notoriously bad at algorithm, that's also a fact, not sure what you're trying to achieve with your post.
            show us your way, how you would improve this shit...

          • 2 months ago
            Anonymous

            i don't have much to say, either. my first instinct is "that would be better as a state machine". that's all.

          • 2 months ago
            Anonymous

            Who got baited? Everybody knows it was a joke

        • 2 months ago
          Anonymous

          You make each of these states set relevant flags when updated and just check for those flags like: moving, inCombat, inSus, inAction, etc."

        • 2 months ago
          Anonymous

          Every time you have so many flags to check, it's time to introduce higher level flags that combine lower-level flags/functions. e.g.
          if ((this.Yandere.LooksSuspicious || this.Yandere.ActsSuspicious) && this.CanSuspect(this.Yandere))

        • 2 months ago
          Anonymous

          Use a behavior tree. Even a moron can make one, and amount of ifs will be close to optimal.

      • 2 months ago
        Anonymous

        Go on. Tell me a better way of checking all of those states.

      • 2 months ago
        Anonymous

        Aa ugly as this is, the compiler shouldn't have much trouble optimizing all that shit. Unlike Clean Code(tm) where the compiler cannot optimize for shit since it doesn't know what any of the classes/methods actually do, here it has only simple data types to worry about.

      • 2 months ago
        Anonymous

        no code morons coping, its all it ever was

        • 2 months ago
          Anonymous

          Right. These people saw this infamous snippet on IQfy and thought, "Yeah, the problem here is that it should be a switch statement." They memed this so hard and cluelessly that they started ridiculing occurrences of "else if" (and sometimes even "if") in codebases other than yandere sim. Obviously, this is an absurd position, but it takes a lot more effort to discredit bullshit than to spread bullshit.

          I'm calling for complete and total shutdown of nocode commentary until they figure out what the hell is going on.

          • 2 months ago
            Anonymous

            Half of those cases could be replaced with this.Witnessed.Contains("Insanity"), same with Weapon.
            But really those strings should be flags, instead of using and to join everything.
            So that code is indeed very moronic, IQfy is probably also moronic though.

          • 2 months ago
            Anonymous

            if (this.teacher) {
            int topBit = 0, tmp = this.witnessed;
            while(tmp>>=1) topBit++;
            this.Subtitle.updateLabel(label_hash[topBit], 6.0f);
            this.gameOverCause = GOC_hash[topBit];
            }

          • 2 months ago
            Anonymous

            if (this.teacher) {
            int topBit = 0;
            for(int i= this.witnessed; i>>=1; ) topBit++;
            this.Subtitle.updateLabel(label_hash[topBit], this.getConcernScore(topBit), 6.0f);
            this.gameOverCause = GOC_hash[topBit];
            }

          • 2 months ago
            Anonymous

            >I'm calling for complete and total shutdown of nocode commentary
            It won't happen because
            >until they figure out what the hell is going on.
            won't happen

            I have never met a more confidently incorrect person than a tech adjacent individual. Sadly that what a lot of gamers and people all over social media are comprised of.

  2. 2 months ago
    Anonymous

    Define easier.
    It's IQfy, actually

  3. 2 months ago
    Anonymous

    Do you even metaprogram, bro?
    let b = true;
    let s = 'function IsEven(number) {n' + 'if(number == 1) return false; n';
    for (let i = 2; i < 100; i++) {
    s += `else if (number == ${i}) return ${b};` + 'n';
    b = !b;
    }
    s += '}';
    eval(s);
    console.log(IsEven(4));

  4. 2 months ago
    Anonymous

    Sorry, I have no idea what odd and even are. I only know Fizz and Buzz.

    • 2 months ago
      Anonymous

      You need either the IsOdd or IsEven library and compile it, then you can link it and use its functions to simplify things.

  5. 2 months ago
    Anonymous

    private bool IsEven(int number){
    return ( number * 10 / 2 % 10 <= 4 )
    }

  6. 2 months ago
    Anonymous

    Look at this beautiful functional code!!!
    #include <stdbool.h>

    bool is_odd(int n);

    bool is_even(int n)
    {
    return n == 0 ? true : n < 0 ? is_odd(-(n + 1)) : is_odd(n - 1);
    }

    bool is_odd(int n)
    {
    return n == 0 ? false : n < 0 ? is_even(-(n + 1)) : is_even(n - 1);
    }

  7. 2 months ago
    Anonymous

    // very good!
    #define IsEven(YourNumber) Math.cos(YourNumber / 3.1415926535897932385).compareTo(Double("1")) ? Boolean.valueOf(Boolean.getBoolean("true").toString()) : Boolean.valueOf(Boolean.getBoolean("False").toString());

  8. 2 months ago
    Anonymous

    def is_even(n)
    return n = 0 or list_contains(factor_tree(n) 2).

  9. 2 months ago
    Anonymous

    int isEven (int n)
    {
    if (n < 0)
    return isEven(-n);

    int even = 1;
    for (int i = 0; i < n; i++)
    even = !even;

    return even;
    }

    • 2 months ago
      Anonymous

      It's quite impressive to watch the compiler trying so hard to make this fast but not being quite clever enough to see the pattern.

  10. 2 months ago
    Anonymous

    #include <iostream>

    bool isEven(int num)
    {
    return (num % 2 == 0);
    }
    int main() {
    // Write C++ code here
    std::cout << isEven(55);
    return 0;
    }

    cmon man

  11. 2 months ago
    Anonymous

    bool isEven (int val) {
    return (val & 1) == 0;
    }

    • 2 months ago
      Anonymous

      it's sad the thread didn't end with this

  12. 2 months ago
    Anonymous

    use is_even;

    fn main() -> Result<(), Box<dyn Err>>{
    for i in (..=100) {
    if let Some(even) = is_even::EvenBuilder(i)
    .build()
    .unwrap().unwrap()
    .expect("Recieved an error")
    .unwrap().unwrap()? {
    let even = match even {
    Ok(x) => x,
    Err(e) => panic!(e)
    };
    if even {
    println!("Is even!");
    } else {
    println!("Is not even!");
    }
    }
    }
    Ok(())
    }

    None of you frickers know safety.

  13. 2 months ago
    Anonymous

    Fellow sirs.

  14. 2 months ago
    Anonymous

    return ! n % 2

  15. 2 months ago
    Anonymous

    #define isEven(a) (1 - (a & 1))

  16. 2 months ago
    Anonymous

    AI fixes morons

    • 2 months ago
      Anonymous
      • 2 months ago
        Anonymous

        >Which would incorrectly indicate that -3 is not even
        I'm told this is coming for my job.

        • 2 months ago
          Anonymous

          Yes by morons who don't understand math

  17. 2 months ago
    Anonymous

    def isOdd(n):
    s = str(n)
    return s[-1] == "1" or s[-1] == "3" or s[-1] == "5" or s[-1] == "7" or s[-1] == "9"

  18. 2 months ago
    Anonymous

    private bool isEven(int number)
    {
    if (number <= 0)
    number = number * (-1);
    for (int i = 0; i < number; i + 2) {
    if (i == number)
    return true;
    }
    return false;
    }

    • 2 months ago
      Anonymous

      this is the objectively correct way to do what he wants. it uses iteration to generate the comparisons programmatically, and even includes optimisations for folding the negative integers into the positives, and only checking half the positive integers, relying on the default case at the end. if modulo and string/bitwise operations didn't exist, then this code would be celebrated. maybe check for fence post problems though.

  19. 2 months ago
    Anonymous

    Good article on this subject:
    >https://andreasjhkarlsson.github.io//jekyll/update/2023/12/27/4-billion-if-statements.html

    • 2 months ago
      Anonymous

      Very nice read. I like the conclusion;

      but computers are magical so who knows what is going on).
      And there we have it! The Internet proven wrong once again,

  20. 2 months ago
    Anonymous

    switch?

  21. 2 months ago
    Anonymous

    import mathematics.numbers.IsEven
    public class Number extends IsEven{
    public Number(int argument){
    super(argument);
    }
    }

    Please merge saaar.

    • 2 months ago
      Anonymous
  22. 2 months ago
    Anonymous

    why would you ever need to know if a number is odd

    • 2 months ago
      Anonymous

      Maybe he wants to distribute the number of boys or girls by the student ID. But no idea beyond that

  23. 2 months ago
    Anonymous

    i'm mentally ill

    isOdd := (n) -> n & 1 |> Boolean

  24. 2 months ago
    Anonymous

    import evenPy as my_even_number

    my_even_number(number)

  25. 2 months ago
    Anonymous

    (fn is-even [x] true)

  26. 2 months ago
    Anonymous

    npm install is-even

Your email address will not be published. Required fields are marked *