Click here to Skip to main content
15,884,425 members
Home / Discussions / C#
   

C#

 
GeneralRe: Azure Active Directory question Pin
Richard Deeming4-Aug-20 23:14
mveRichard Deeming4-Aug-20 23:14 
GeneralRe: Azure Active Directory question Pin
pkfox5-Aug-20 3:12
professionalpkfox5-Aug-20 3:12 
GeneralRe: Azure Active Directory question Pin
pkfox4-Aug-20 23:12
professionalpkfox4-Aug-20 23:12 
QuestionHow to change the aspect ratio of an Windows media player by using C# Pin
Member 1488657531-Jul-20 0:25
Member 1488657531-Jul-20 0:25 
AnswerRe: How to change the aspect ratio of an Windows media player by using C# Pin
Gerry Schmitz31-Jul-20 7:32
mveGerry Schmitz31-Jul-20 7:32 
QuestionName Generator Pin
Brandnoob30-Jul-20 8:04
Brandnoob30-Jul-20 8:04 
AnswerRe: Name Generator Pin
Gerry Schmitz30-Jul-20 8:10
mveGerry Schmitz30-Jul-20 8:10 
AnswerRe: Name Generator Pin
OriginalGriff30-Jul-20 8:55
mveOriginalGriff30-Jul-20 8:55 
Load your verbs into a collection - an array or list, whichever you want.
Do the same with the adjectives
Then create another collection which takes two indexes into the collections: that stores the "used" tags so you don't repeat. A Dictionary<int, int> should do it. Load it with the gamertags that you've actually issued.
Now, to generate a new tag, pick two indexes at random. Check to see if they are already used together. If they aren't, add them, and you have your tag.
If not, generate two more and try again.

Think of it as if you were doing it with a paper and pencil, and you'll see what I mean.

There are more efficient ways (ensuring you can't generate duplicates instead of checking for them) but they are rather more complicated, particularly for a beginner.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!

QuestionExecuteScalar to cshtml view Pin
Member 1490312930-Jul-20 5:30
Member 1490312930-Jul-20 5:30 
AnswerRe: ExecuteScalar to cshtml view Pin
Gerry Schmitz30-Jul-20 8:02
mveGerry Schmitz30-Jul-20 8:02 
GeneralRe: ExecuteScalar to cshtml view Pin
Member 1490312930-Jul-20 11:42
Member 1490312930-Jul-20 11:42 
GeneralRe: ExecuteScalar to cshtml view Pin
Dave Kreskowiak30-Jul-20 12:47
mveDave Kreskowiak30-Jul-20 12:47 
GeneralRe: ExecuteScalar to cshtml view Pin
Member 1490312930-Jul-20 12:55
Member 1490312930-Jul-20 12:55 
GeneralRe: ExecuteScalar to cshtml view Pin
Dave Kreskowiak30-Jul-20 13:17
mveDave Kreskowiak30-Jul-20 13:17 
GeneralRe: ExecuteScalar to cshtml view Pin
Member 1490312930-Jul-20 13:26
Member 1490312930-Jul-20 13:26 
GeneralRe: ExecuteScalar to cshtml view Pin
Dave Kreskowiak30-Jul-20 17:10
mveDave Kreskowiak30-Jul-20 17:10 
GeneralRe: ExecuteScalar to cshtml view Pin
Gerry Schmitz31-Jul-20 7:40
mveGerry Schmitz31-Jul-20 7:40 
GeneralRe: ExecuteScalar to cshtml view Pin
Dave Kreskowiak31-Jul-20 7:54
mveDave Kreskowiak31-Jul-20 7:54 
GeneralRe: ExecuteScalar to cshtml view Pin
Gerry Schmitz31-Jul-20 12:58
mveGerry Schmitz31-Jul-20 12:58 
GeneralRe: ExecuteScalar to cshtml view Pin
Dave Kreskowiak31-Jul-20 14:01
mveDave Kreskowiak31-Jul-20 14:01 
SuggestionRe: ExecuteScalar to cshtml view Pin
Richard Deeming4-Aug-20 0:05
mveRichard Deeming4-Aug-20 0:05 
GeneralRe: ExecuteScalar to cshtml view Pin
Dave Kreskowiak4-Aug-20 4:01
mveDave Kreskowiak4-Aug-20 4:01 
QuestionHaving the image at the third second of a video Pin
Tec Zone30-Jul-20 6:11
Tec Zone30-Jul-20 6:11 
AnswerRe: Having the image at the third second of a video Pin
CHill6030-Jul-20 6:12
mveCHill6030-Jul-20 6:12 
AnswerRe: Having the image at the third second of a video Pin
jsc4230-Jul-20 6:25
professionaljsc4230-Jul-20 6:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.