Pete's Log: contest coding
Entry #858, (Coding, Hacking, & CS stuff)(posted when I was 22 years old.)
So not really feeling like doing much else, I found myself some programming contest problems to hack on. I found the problem set for the 1994 western european regional acm programming contest. Did the first two problems tonight. Problem A was simple enough, took an hour, but it was fun to play with C++ string manipulation, since I usually do such things with C strings. but it's all pretty much the same thing over all. The second problem was slightly trickier. It involved parsing a language that describes a data type that can be made up of arrays, strings, enums, records, and such. So I wrote a recursive descent parser and a lexer to do this. An hour to write the code, another hour or more spent debugging. It all mainly came down to me having some issues with iostreams. If I'd have done this one in C, it seems likely I'd have gotten it right the first time through. I'm thinking of rewriting it in C, but maybe later. It was fun, though, to write a lexer from scratch. Woo. Need to do more of this later. But now I must sleep.