Author: John Merlino
Date: 21:45:57 02/09/06
Go up one level in this thread
On February 09, 2006 at 23:53:33, Derek Mauro wrote: >So, today I found out that there was going to be an ACM programming contest at >my school. Someone who knew I liked to program told me I should participate for >fun. It was an algorithm contest. We were given 4 problems to solve in two >hours. > >I read the first question. Basically, you were given a 4x4 magic square (see >http://en.wikipedia.org/wiki/Magic_square if you don't know what that is) with 2 >spots missing. Fill in the 2 missing spots and print the magic square. This is >a pretty easy problem, and I figured it shouldn't take more than 10 minutes, if >even that long. > >I looked at the second question, and my eyes lit up. The title of the problem >was “Endgame”. You were given a chessboard as 8 lines of text to stdin (for >example, rnbqkbnr for the first line). The positions were guaranteed to be a >mate-in-1. You can ignore castling, en passant, and moving a pawn forward 2 >squares. Print the position after the mating move. Now, I think it would be a >pretty safe bet that I knew more about chess programming than the other 30 or so >contestants in the room combined. I should have a huge advantage here. > >Silly me, instead of doing the easy question first, I immediately started coding >the chess question. 15 minutes later I realized that the contest is first based >on the number of questions you solve, and if there's a tie, the time you took, >so I better just do the easy one first. > >I race through the magic square problem, print a sample problem, it doesn't >work. I quickly saw the error in my mental math and fixed it, which (somehow) >made me only the 4th person to submit a correct answer up to that point. > >I spent the rest of the time working on the chess problem. I had an almost >working program with 50 minutes left of the original 2 hours, but I spent >another 10 minutes figuring out why the IO didn't work. > >When you submit you answer, the system automatically tries several test cases. >It indicated that my program crashed. Strange. Non of the test cases I tried >caused a crash. I tried using the Visual C++ debugger. Unfortunately, the >computers we were using were configured so that you can't debug a program unless >you are an administrator. Idiots. The tournament director had no idea about >this. > >I never figured out why the program was crashing. But I finished in 4th, >winning me a Visual Studio t-shirt, with a Napoleon Dynamite (stupidest movie >ever) joke on the back. I actually didn't read the other problems during the >contest, because I was so determined to finish the chess question, but looking >at them now, I think would have been able to do both (no one actually solved >them). As far as I can tell, the solutions to the other 2 questions are much >much shorter, and not nearly as tedious. The other problems are pretty cool, >maybe I'll post the problems in CTF, if anyone is interested. > >So as I sit here dejected that I couldn't solve a problem I've spent years on, >I'd like ask everyone this question: How confident are you that you can 100% >accurately write the solution to the chess question in less than 2 hours, under >the pressure of competition, without the use of a debugger? > >Or am I just an idiot? :) Although I've never written a chess engine, I have been a programmer for over 20 years. And I can confidently say that I couldn't write that program in less than a day (8 hours) without a debugger. jm
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.