Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 149,427 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 2,259 people online right now. Registration is fast and FREE... Join Now!




Randomize the alphabet

 
Reply to this topicStart new topic

Randomize the alphabet, randomly pick a letter from the alphabet

chevywes
28 Jan, 2008 - 09:13 AM
Post #1

New D.I.C Head
*

Joined: 24 Jan, 2008
Posts: 44

I want to pick a letter from the alphabet in lower case and match it to what I have above. eg. if rand kk = a then jan1 would show in a text box as 1/2

What I'm trying to accomplish is to make a schedule were a group would meet with another group once a month. I want all the groups to meet with one another.

there are 4 location where they meet every month, these location stay the same.

This is what the finished product will look like.

Jan Feb Mar Apr May .... Dec
Location1 3/8 2/4 1/5

Location2 2/5 1/7 3/6

Location3 1/4 6/8 2/7

Location4 6/7 3/5 4/8

I know there will be duplicates, but I'm trying to even them out the best I can.
Does this make any sence to you people, if not I'll try to explain it better some how.

I've tried various ways with just numbers alone, but I thought I'd try this way in groups.

Thanks for your help
wes

CODE

TextBox1.Text = ""
        Randomize()

        a = "1/2" : b = "2/3" : c = "3/4" : d = "4/5" : e1 = "5/6" : f = "6/7" : g = "7/8" : h = "1/3" : i = "2/4"
        j = "3/5" : k = "4/6" : l = "5/7" : m = "6/8" : n = "1/4" : o = "2/5" : p = "3/6" : q = "4/7" : r = "5/8"
        s = "1/5" : t = "2/6" : u = "3/7" : v = "4/8" : w = "1/6" : x = "2/7" : y = "3/8" : z = "1/7" : aa = "1/8" : bb = "2/8"

        '''' generating list for Jan
        jan1 = "" : jan2 = "" : jan3 = "" : jan4 = ""
        kk = ""
        Do
            dupes = False
            kk = Int(Rnd() * 122) + 1
            If kk > 64 And kk < 123 Then
                jan1 = Chr(kk)
                MsgBox(jan1)
            Else
                dupes = True
            End If
        Loop Until dupes = False

User is offlineProfile CardPM
+Quote Post

chevywes
RE: Randomize The Alphabet
28 Jan, 2008 - 09:23 AM
Post #2

New D.I.C Head
*

Joined: 24 Jan, 2008
Posts: 44

OH I guess I also have to compare strings.
chr(kk) with the chr above. eg. if chr(kk) = a then I have to loop it through my list to get a = "1/2" right.

So I guess I have to dim all those other chr's that = " number/number" ... right

Oh it looks like I have a lot of work to do.

thanks again wes

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 11:20AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month