•2 months ago
published an Update
Cricket RNGThis is a rng generator that is weighted to make it more realistic for cricket. The program randomly generates a number between 1 and 100 and if that number falls between a certain range, a certain value is displayed in the console. This also includes run rate, total score/wickets, wides, timelines of overs and a full timeline of each inning, powerplay weighted percentages and special percentages when a score is high or low, etc. Most people on replit are from America so a lot of you won't know what cricket is. If so ask away in the comments and I will do my best to help! Oh and yes this is a console program built in C++. I understand it is a bit simple but have tons of features planned in my trello. If you think any of the percentages should be changed, or if you find any bugs (most are related to all out as that doesn't happen frequently), please feel free to tell me in the comments!
Fatster Code, Fixed Bugs, and UBs no moreThough I made this update for the Creator's Fund and actually missed the deadline due to my internet dying, this project still was terrific for me. It taught me about UB (Undefined Behavior) and OOB (Out of Bounds), two essential contents for errors in C++. I also learned ways to make the code function faster and reduce the size of the code, as the code was a bit lengthy. Thanks creator fund for the 'opportunity', though I didn't deliver lmho! Oh and if you are wondering why I had to wait until the last minute to submit, it was a mixture of laziness, me not knowing the creator fund was only for three months, late responses from helpers on discord, and UB errors (which wasted over a week of me trying to find out why first the program crashed when incrementing and integer and second why pushing back to a vector crashed the program). Oh, one last thing - I reduced the code's length from 709 characters to 472 (237 difference), this being the major change in the program as I didn't add any new features. I felt like bug fixes (mainly occurring with all out messages) needed to be attended to and the code's repetition needed to be cut as it added way too much extra lines.