Is there anything noticeably wrong with this code?

Post here about scripting and programming for HaloPC (audio, network, ai, etc.)
Post Reply
User avatar
FleetAdmiralBacon




Critic Pyre Articulatist 500

Posts: 2377
Joined: Sat Nov 26, 2005 7:01 pm
Location: Ohio
Contact:

Is there anything noticeably wrong with this code?

Post by FleetAdmiralBacon »

This particular problem involved translating a block of text into Pig Latin. Fairly simple stuff, even with all the rules. Hell, my program works perfectly for me:
Here's the code.
Here's the output when I send it my entire English paper.

But the contest advisors were getting a very strange bug at run time: Halfway through their output they started to get seemingly random, non-text characters - as if the ouput had been shifted over in binary space. Now, as my paper is 1250+ words and combines most all of the exceptions and special cases given by the problem (which I shouldn't need to post, but if you need clarification on something specific I will scan the paper), there should be no problems. My output is all perfectly correct, everything is formatted properly, and I'm not getting "gibberish" (as they first described, which was rather pointless as 'gibberish' was what the output should have been, they later clarified as I mentioned above). So, I want to put this one out there for people to look at - can any one else reproduce the contest officials' results?
I'll be putting a little PHP script up that will run the program from my server so people without the time or patience to compile it themselves can still try random input.
edit: That should do it...
Image
Everything you'll ever need to know about me.
Need help with Linux, C#, C, Python, Java, PHP, Javascript, CSS, or VB? I'm available from 3:00PM-8:00PM EST on weekdays.
User avatar
kornman00




ONI New Age

Posts: 146
Joined: Fri Dec 12, 2003 6:30 pm
Contact:

Post by kornman00 »

Example of the input\output of a problematic entry?
User avatar
FleetAdmiralBacon




Critic Pyre Articulatist 500

Posts: 2377
Joined: Sat Nov 26, 2005 7:01 pm
Location: Ohio
Contact:

Post by FleetAdmiralBacon »

kornman00 wrote:Example of the input\output of a problematic entry?
I can't find any problematic input, but the result was "non-ASCII gibberish about halfway through [...] as if the output was shifted".
Image
Everything you'll ever need to know about me.
Need help with Linux, C#, C, Python, Java, PHP, Javascript, CSS, or VB? I'm available from 3:00PM-8:00PM EST on weekdays.
Post Reply