I mentioned a programming assignment in the Med School Malpractice thread, and figured that further details (not so relevant to that thread) are worth mentioning.
My current assignment for Soft Computing at uni is to fix/improve the AI on a game called which is similar to Worms but has witchetty grubs instead of worms. The AI uses Fuzzy Logic (it's a demo of the fuzzy logic system) and the game and framework were written as a student project last year. The whole game is written in Lua, and the graphics are done with DirectX (not that you touch it at this level of the the framework).
Anyhow, one of the things I need to do is make the AI check to see how far off it was and make corrections accordingly. Plus I need to improve the fuzzy sets and rules a bit so it's not so far out in some cases.
The code is interestingly convoluted. Between the occasional unexplained commented-out lines, and explanatory comments that merely reflect what the code does - I mean used to do before changes were made - I even found a function which takes no parameters, sets some local variables (using the values of globals), and returns nothing. Thus useless function is not called. Seems to be a partial algorithm that was never finished.
Yesterday I removed the following two functions, each of which was called twice.
-----------------------------------YDiff------------------------------------------------
----------------------------------------------------------------------------------------
function YDiff(y1,y2)
return y1-y2
end
-----------------------------------XDiff------------------------------------------------
----------------------------------------------------------------------------------------
function XDiff(x1,x2)
return x1-x2
end
I think all functions have a 'title' comment like those two did. A few even say what the function does, on a third line. There's also some comments which seem to say hasn't been done, or express doubts about what is being done
All the fuzzy rule functions contain the following cryptic comment, which was in the original sample code for fuzzy rules, which pertains to a specific example that has nothing to do with the game:
-- mebership amount of poor skill goes into temp
Oh, and the sideways movement of the grubs (your grubs can walk - I also have the task of making the AI walk) seems to occur only at the end of the FallingCheck function and the beginning of the ClimbingCheck function.
Ban FB and bring back MPS - he had a much cooler username!
Legendary Threadlolwtf: Instead of comfy chair, package contained bobcat. Would not buy again.
curtmack: It's like Godwin's Law, but instead of Hitler it's xkcd references.
morbiuswilters: Right, but the Holocaust wasn't nearly as bad as xkcd.