CSharp · Console
using System;
using System.Collections.Generic;
using System.Linq;
public class Program
{
public static void Main()
{
List<string> animalEmoji = new List<string>()
{
"🦊", "🦊",
"🐱", "🐱",
"🐸", "🐸",
"🐹", "🐹",
"🦒", "🦒",
"🐭","🐭",
"🦄","🦄",
"🦝","🦝",
};
Random random = new Random();
var s = "";
for(int i = 0; i<999;i++)
{
int index = random.Next(animalEmoji.Count);
try{
string nextEmoji = animalEmoji[index];
s = nextEmoji;
animalEmoji.RemoveAt(index);
}catch(Exception ex){
Console.WriteLine(ex.Message + " while trying to access index " + index);
}
}
}
}