
-----------------------------------
TipsyCzar
Thu Nov 10, 2016 12:18 pm

Rudimentary turing gmae
-----------------------------------
This is a game I made for a computer science class. It's supposed to take the base principal of Duck hunt (use mouse and graphics VS just text). Tell me what you think of it and what needs work. If possible, look at the code and see if the indent needs work.

-----------------------------------
Insectoid
Fri Nov 11, 2016 9:52 am

RE:Rudimentary turing gmae
-----------------------------------
It's funny you asked about the indent because it definitely needs work. That's some crazy unnecessary nesting you've got going on there. Fortunately it's an easy fix. Load up Turing, open your file, and press F2. There, fixed. The automatic indenting will give you the proper indentation. There's no need to come up with your own complicated system. If everyone uses the auto-indent, then everyone's indentation is the same, and everyone can easily read each others' code. 

Now that we can read this file, take a look at your variable declarations:identical pieces of code, then we can just delete 13 of them and throw the other one in a loop! This saves us a whopping ~180 lines of code! 

You posted ~360 lines of code, not including blank lines. We're knocking out ~270 of them, which leaves us with 90 lines. 360, to 90. That's a 75% reduction in code size, and a 100% increase in readability, just by eliminating repeated code. 
 
Repeated code is generally not a good thing. Makes things messy and hard to edit. Any time you see code that looks the same or nearly the same, see if you can eliminate all the extras and bring it down to just one copy. This will often massively reduce the size of your file and make it much, much easier to edit and debug.
