Keep Talking and Nobody Explodes

Keep Talking and Nobody Explodes

Not enough ratings
Prime Checker
   
Award
Favorite
Favorited
Unfavorite
Modules: Regular Module
File Size
Posted
Updated
2.014 MB
28 Oct, 2019 @ 1:17pm
28 Apr, 2021 @ 12:10pm
7 Change Notes ( view )

Subscribe to download
Prime Checker

In 2 collections by eXish
eXish's Modules
122 items
Official Twitch Plays Module Collection [OUTDATED]
813 items
Description
NOTE: This is a reupload of a module that has lost maintaining, please unsubscribe from the old version: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1807034913

Find out if shown number from 1-999 is prime or not.

HTML: https://ktane.timwi.de/HTML/Prime%20Checker.html
PDF: https://ktane.timwi.de/PDF/Prime%20Checker.pdf

Prime Checker (PrimeChecker) v1.0.5
Module by Devster_LP, maintained by eXish
Twitch Plays supported
3 Comments
eXish  [author] 30 Dec, 2019 @ 11:45am 
Thanks for letting me know
Dark Heresy 30 Dec, 2019 @ 10:25am 
Also, but this is minor, the odds of generating a prime number vs a nonprime number are not 50/50. This is because the random function generates a number from 1 to 99 (change the first argument to 0 for 50/50 odds)
Dark Heresy 30 Dec, 2019 @ 10:11am 
This module is broken. I've looked at the code and found a few problems:
The Split function returns a 0-based array, but the index that gets randomly generated goes from 1 (inclusive) to array length (exclusive), meaning it will never return element 0. Also, the \n separated string for nonprimes contains a trailing \n, which means the split function will return an empty string for its final element, which can't be converted to a number by int.Parse.

I don't understand why \n separated strings are used for this in the first place. Why not just create an array of integers? this seems much more efficient. No need to do any splitting or parsing then.