Ad
  • Custom User Avatar

    hehe that's not assembly/machine code... that is just a char replacement table for rot13, but instead of defining it with bytes/chars which would make it bigger/obvious... i defined them using 64bit unsigned integers... i.e. each pair of hex digits correspond to a byte... hence why when i access it i cast the pointer to char* to access it as a regular char table.

    either way it's possible to have machine code defined in an array and call it just like you would call a dynamic loaded function... i.e. with a function pointer pointing to the array. (normally this array have to be as local in the stack, because there's read/write/exec permissions for the stack, otherwise system specific functions would need to be called to set the exec privileges)

  • Custom User Avatar

    hehe i manually adjusted the precision to overcome rounding errors... i guess the -0.25 is a hack to make the answer fit

  • Custom User Avatar

    no, otherwise it would be pointless to have kata's marked with "mathematics", fundamentals are fundamentals concept in programming, and this kata was entirely based on a math principle (its solving a math problem).

  • Custom User Avatar

    the attempt tests on C are correct?

    alice: fare cans left slap gain slam pate even mane peel
    bob: oats gaze feet feat pats golf cope maze caps flaw
    Start word: 'aver' Start player: 'alice'

    Expected: 0 (Alice) Submitted: -1 (neither)
    ?? so the word should be 'ever'? but even if i fix the word, it fails later ??

    alice: fare cans left slap gain slam pate even mane peel
    bob: oats gaze feet feat pats golf cope maze caps flaw
    Start word: 'spam' Start player: 'alice'
    Expected: 1 (Bob) Submitted: 0 (Alice)

    so obviously alice plays slam... bob loses... but the tests says different...
    i tought i was modifying the array or something but i double checked and i'm not
    this is weird, as nobody mentioned it already... so confused :P

  • Custom User Avatar

    another that cleraly have mathematics jargon... and isnt tagged mathematics...

  • Custom User Avatar

    this is tagged as "fundamentals" when its clearly mathematics/algebra, or whatever i dont even know what i'm suppose to do since it uses terms specific to... algebra? either way can it be re-tagged?

  • Custom User Avatar

    alright so it got fixed! :)

  • Custom User Avatar

    nvmd... it was sscanf being sscanf and corrupting the numbers.

  • Custom User Avatar

    ok... this is a dejavu... i think the C random tests are broken... or the description is not describing something...
    because it fails on random tests i ordered the alarms and clearly there is 07:28 07:28 07:50 10:00 10:00... which is a 02:09 time difference... yet the "expected" says "00:30"

  • Custom User Avatar

    oh sorry i tought i had mentioned... yes it is C

  • Custom User Avatar

    either the tests are wrong... or the description is incomplete...
    because for example on the random test i found 7 w's on the strings... so it gotta be 7 alphabets... but the "expected" have no 'a' when theres no 7 'a' on the string...

  • Custom User Avatar

    the hint is that the tester mentions what you should do :P, altough its not imediatelly logical that doing such would actually speed up enough to pass... SPECIALLY since those who are not paid members dont really get the capability for such (for real).

  • Custom User Avatar

    really you are comparing floats with equality? thats a fail :)

  • Custom User Avatar
  • Custom User Avatar

    why the test cases are not performing any random tests?

  • Loading more items...