1. 27

  2. 5

    The beauty of the Underhanded C contest is that a problem that is seemingly so simple is turned into something malicious. See last year’s prompt:

    Your goal is to write the function that compares a test measurement to a reference pattern:

    int match( double * test, double * reference, int bins, double threshold )

    …where test and reference are 1-dimensional arrays of width bins, that encode a gamma ray spectrum of a test warhead and a reference warhead, respectively. Your detector should output a 1 (“yes”) if these two arrays are sufficiently similar, and 0 (“no”) otherwise; you should use the parameter threshold to adjust the sensitivity of the match.

    You are free to use any formula to decide if test[] and reference[] are a close match, as long as it is justifiably accurate: i.e., that two very similar signals match for a reasonable threshold, and two clearly distinguishable signals fail to match for some threshold. You will get more points for using a common comparison formula or detector structure; something weird and ad-hoc may be suspicious and hard to justify.

    The Underhanded Rust Contest’s prompt to create a web server that supports (“at least!”) creating accounts and handling payments, by comparison, is enormous. This is not to say the contest has no worth (I’m really excited to see the responses), but it may reach different goals than a contest with shorter solutions would.

    1. 3

      /u/Manishearth replied to my comment on reddit, reproduced here:

      We were afraid that it might be too hard to write underhanded Rust code for something that tiny – most of the tricks used in underhanded C don’t work in Rust). If it turns out that this is too easy we will change the scope next year.

      (Additionally, it’s not actually that complicated. Account creation and submitting payments are mostly simple operations. Robust implementations with email verification &c are harder, but that’s not what we’re looking for)

      Makes a lot of sense.