Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
4 Distinct Integer Custom Code Generator
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { var random = new Random(); int[] nums = new int[4] {2,3,4,5}; int one; int two; int three; int four; List<string> storeList = new List<string>(); string[] storeArray = new string[9999]; string code; int i = 0; while(i < 2000) { one = nums[random.Next(0, nums.Length)]; two = nums[random.Next(0, nums.Length)]; three = nums[random.Next(0, nums.Length)]; four = nums[random.Next(0, nums.Length)]; code = one.ToString() + two.ToString() + three.ToString() + four.ToString(); if(one == two || one == three || one == four || two == three || two == four || three == four) { } else { storeList.Add(code); } storeArray = storeList.ToArray(); i++; } List<string> distinctStoreList = storeList.Distinct().ToList(); distinctStoreList.Sort(); for (int j = 0; j<storeArray.Count(); j++) { Console.WriteLine(distinctStoreList[j]); } } } }
run
|
edit
|
history
|
help
0
Problem: rstring
Game v 1.0
25
The abstract factory design pattern implemented in c# using generics.
Testing 006
My First Hello world
ObjectPool
Calculator Test
1. Basics: primitive data types
https://www.usgatmtu.mtu.edu/profile/watch-the-bad-guys-online-streaming/profile