Evan Martin (evan) wrote in evan_tech,
Evan Martin
evan
evan_tech

icfp!

This weekend I've been working on the ICFP contest again.
I'm taking much more casually than last year -- I started after dinner last night and gave it just a few hours -- but the fun is not in being a strong competitor but in solving the problems.

I lost a good four hours today tracking down a C++ precedence bug. I needed to test whether a number was even and wrote
if (i & 1 == 0)
which unfortunately parses as
if (i & (1 == 0))
which is true for all nonzero i always false.

The worst part of it is, they provided a check program that told me nearly exactly where the problem was, but I looked over that code and convinced myself it was so obviously correct that a bug elsewhere must be cascading into the failure here.

That's what I get for being too clever, I guess! Shoulda just used mod in the first place.
(I'm also a little bummed that speed concerns have kept me from using any languages other than C++, though really we should've gotten to this point midday yesterday...)
Tags: icfp
Subscribe

  • your vcs sucks

    I've been hacking on some Haskell stuff lately that's all managed in darcs and it's reminded me of an observation I made over two years ago now (see…

  • git evangelism: enough already

    As a person who uses Git extensively and thoroughly, and as someone works on/around two large open source projects (Chrome, WebKit) that are managed…

  • using git with svnsync

    git.chromium.org is a git-svn mirror of the canonical SVN repository. It works like this: the SVN server pushes out, with svnsync, a mirror to…

  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 9 comments