Horje
randomm number from 2 different ranges Code Example
randomm number from 2 different ranges
/* Using Ternary Operator
	(condition) ? (if true, do this) : (otherwise, do this)
Have Initial Range from 1-2. Generate either 1 or 2. 
	If generates 1, then [true] range will be accepted (65-90 in this case)
	If generates 2, [false] range will be chosen (97-122 in this case) */
Random rnd = new Random();
int randomNum = rnd.Next(1, 3) == 1 ? rnd.Next(65, 91) : rnd.Next(97,123);

/* This method might not produce perfect probability distribution for all 
values if range sizes are not equal. The individual terms belonging to the 
larger range size will appear fewer times vs the individual terms in the 
smaller range */




Csharp

Related
unity create a child object Code Example unity create a child object Code Example
how to clone somthing unity Code Example how to clone somthing unity Code Example
c# check if string is only letters and numbers Code Example c# check if string is only letters and numbers Code Example
how to convert nullable datetime datarow to datetime in c# Code Example how to convert nullable datetime datarow to datetime in c# Code Example
how to get object to spawn in a curcle Code Example how to get object to spawn in a curcle Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9