Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 29th, 2005, 01:23 AM
Registered User
 
Join Date: Oct 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to create a random alphabet?

   I'm a chinese cllege student,last week,my techer ask us to do a simple game,but there is a problem i could not solve,"How to create a random alphabet"?My English is poor ,maybe make you difficult to understand,but I do hope someone can help me!
    Thank you!

 
Old October 29th, 2005, 10:33 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

There are two approaches I can think of off hand.
One would be to create a random number in the range of the ascii alphabet characters.
and convert to the ascii character for that number.
The other would be to load all acceptable alphabetic characters into a collection and randomly select an index in the collections range. This would be better if you wished to remove the character to only select it once.
Cant remember the range off the top of my head, and it would vary if you are using chinese characters.

======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem when i create a random code verification srkarthik_82 C# 2005 1 November 26th, 2007 05:17 AM
Create random statements ghall202 Access VBA 3 October 3rd, 2007 07:08 AM
chinese alphabet Adam H-W SQL Language 4 November 16th, 2004 04:16 AM
Random Numbers not so random... katsarosj ASP.NET 1.0 and 1.1 Basics 5 November 20th, 2003 12:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.