Baseball game dev diary version 0.2.1.202011192214: rewriting 60 lines of code as 4

  1.  Changed the temporary setLineUp and setSquad procedures to use loops instead of repetitive code. The 300 + (teamtemp*100) + playeridtemp means that for team 0 the squad IDs are set as 300+ and for team 1, set as 400+. 
Doing this was a no-brainer, not sure why I previously had 60+ lines in setSquad and 20+ lines in setLineUp. Probably a combination of it being late when I thought of it and figuring it was only temporary anyway so not thinking too much about it. Identifying when to use loops is usually what I'm good at. I'm so embarrassed.


You may have worked out by now I'm doing this in Visual Basic. This is simply because it's the language that I can most easily code in off the top of my head, creating a simple user interface is super easy (rather than having to create a web page which is much more time consuming) and I can then turn them into algorithms later which can be converted to whichever language I want (most likely Python or PHP).

It was at this point that it occurred to me that I was committing the cardinal sin of not actually keeping copies of each version. I'm sure it's good practice to do so, also it would be nice to compare a year from now to the current version. A bit silly not to, considering it presently only takes up approx 4MB per version.

Comments

Popular posts from this blog

MLB (Road to) The Show attribute progression

MLB The Show 21: create a stadium prediction & using created stadiums in online games

V1.1.4.202103032300 Basic player creator, line score tidy up and additional play results, including errors