Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
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.