7

I made a script that performs some analysis on data from a trading card game tournament and I would appreciate your input

Project Type
Existing open source project
Summary

I made a script that performs some analysis on data from a trading card game tournament and I would appreciate your input

Description
I recently competed in TESPA's Hearthstone tournament and got fed up with manually checking all this data so I wrote a program to do it for me. I don't have much experience in programming at all and I would very much appreciate any advice you have for me, especially if I'm fucking up something major.
Tech Stack
C#, Google Sheets API, HearthSim's HearthDB library
Current Team Size
me
URL
Comments
  • 1
    That is one big program.cs Would it not make more sense to have class Deck { List<Card> Card{get; set; } where Card is an abstract class and Mage/Warrior act are specialisations
  • 1
    where you say you wish you could collapse that big block just do

    #region "Lots of declarations"

    ... yourcode...

    #endregion

    and you will get collapse markers like you do for methods etc
  • 1
    string toPrint = ""; //this is faster than lots of Console.WriteLine() calls

    You then add to this by doing toPrint += something + something_else

    If instead you used a string builder and appended to it this it would be more efficient. The += and + operators on string for concatenation are the least efficient as it has to create an extra string allocation. StringBuilder doesn't
  • 1
    @gruff
    Deck is already a class in the HearthDB library. I know HearthSim has a much more efficient and flexible algorithm for guessing deck archetypes (they use it for HSReplay.net), but I don't have access to that and a massive if block works well enough for my purposes.
    I should probably split the Google Sheets reader into a separate file, though.

    Thanks for the #region tip 🙂

    And thanks for the tip about StringBuilder. I think I vaguely remember using it in class once, but after that we went back to += so I forgot all about it :/

    How do you like the readme? Did it get you set up without any extra searching?
  • 1
    I only browsed through the repository to see if there was any pointers I could give you to be honest
  • 1
    oh and the readme is better than the ones I usually do haha
  • 0
    @gruff I did try extra hard to make it look nice since it's the first time I've made my code public 😛
Your Job Suck?
Get a Better Job
Add Comment