Ad
  • Custom User Avatar

    except that... on CW, since the katas are TDD-based, any solution that passes the tests is a valid solution. So blame the author, not the warrior. ;)

  • Custom User Avatar

    All valid points. Look-up tables are a time-tested optimisation in several computing solutions.

    The only thing that this solution falls afoul of is that the problem specifically asks one to COMPUTE the value.

  • Custom User Avatar

    Not just vintage games like Doom. Most modern calculators/[cg]pus will use some form of lookup tables for transcendentals. There are performant alternatives when lookup is not available (in memory limited applications like old microcontrollers), but if you have the option, it would make no sense to go for the slower more complicated algorithm. Lookup tables aren't just limited to calculating transcendentals, they are ubiquitous across software and hardware.

  • Custom User Avatar

    That's what was used in Doom (yes, original Doom 1). Instead of calculating sin/cos they had a table.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Well, one can do it manually, but such a feature would be nice.
    Or maybe, some sort of "favourite" code collection (that user favourites as he goes) that you can see like a summary in your own profile.