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

Train Carriage Game Solutions

Name: Anonymous 2012-08-26 2:11

I'm looking to program a function that can check if you can "make 10" from some 4 digit number (0000 to 9999).

The function should use these rules when performing the check:
https://www.facebook.com/pages/Train-Carriage-Game/108348062559174?sk=info

Does /prog/ know if there's a simple way to perform such a check short of checking every combination individually? I obviously don't want to be writing the following:


boolean makesTen (int a, int b, int c, int d) {
    if (a + b + c + d == 10) {
        return true;
    } else if (-a + b + c + d == 10) {
        return true;
    } else if (a - b + c + d == 10) {
        return true;
    }
    ...
    ...
    } else {
        return false;
    }
}

Name: Anonymous 2012-08-30 0:13

>>48
Would only be slightly more difficult. I didn't check out the rules because who doesn't have facebook blocked?

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