![]() |
|
[.NET] What to do when you're bored. - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] What to do when you're bored. (/showthread.php?tid=4685842) |
What to do when you're bored. - LijpeMD - Feb 14, 2015 I had nothing to do so I just created this little thing, copy & paste the code in your console application and then run it. Code Module ConsoleModuleSo what you do is specify an integer, then specify the minimum and maximum range and it will generate a random integer between that range until your specific integer is generated and tell you how many times it tried to reach that integer. Tell me if I need to improve something. * - taktaktak - Feb 14, 2015 Please use Option Strict you could really use it... * - LijpeMD - Feb 14, 2015 (Feb 14, 2015 06:27 PM)Killpot Wrote: Please use Option Strict you could really use it... What do you mean with that? Only mistake I see is that I didn't use CINT. But Option Strict was off by mistake. * - taktaktak - Feb 14, 2015 (Feb 14, 2015 06:44 PM)Smell Wrote: What do you mean with that? Only mistake I see is that I didn't use CINT. Well now that you've added it, it's better but it would just crash allot as the console would accept anything, even now your not doing anything to prevent someone typing in actual non-integer characters. * - LijpeMD - Feb 14, 2015 (Feb 14, 2015 07:04 PM)Killpot Wrote: Well now that you've added it, it's better but it would just crash allot as the console would accept anything, even now your not doing anything to prevent someone typing in actual non-integer characters. Why are you trying to make me look stupid? Why would someone put in non-integer characters if they want to make the program work properly? I gave out the source so you can fix that yourself by simply adding a Try Catch statement, or disallow non-integer characters. * - taktaktak - Feb 14, 2015 (Feb 14, 2015 07:14 PM)Smell Wrote: Why are you trying to make me look stupid? Why would someone put in non-integer characters if they want to make the program work properly? I gave out the source so you can fix that yourself by simply adding a Try Catch statement, or disallow non-integer characters. Yes, and it's just good practice. Because considering you weren't using Cint on something that clearly needed it I question your ability and how well you practice good coding habits. * - iTeDDy - Feb 15, 2015 Fun if you are bored! Thanks! 😁 |