Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class frmWLNameGen
- Dim alphabet As String = "abcdefghijklmnopqrstuvwxyz"
- Dim consonants As String = "bcdfghjklmnpqrstvwxyz"
- Dim vowels As String = "aeiou"
- Dim ID As Integer = 0
- Private Sub frmWLNameGen_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- txtOutput.Text = ""
- nudStuff.Minimum = 2
- nudStuff.Value = 5
- End Sub
- Private Sub txtOutput_Click(sender As Object, e As EventArgs) Handles txtOutput.Click
- Dim the_text As String = ""
- Dim randomness As Random = New System.Random
- Dim one_or_zero As Integer = 0
- txtOutput.Text = ""
- If cmbPrefix.Text = "Bonus Link" Then
- txtOutput.Text = "BonusLink_"
- ElseIf cmbPrefix.Text = "Territory ID"
- txtOutput.Text = "Territory_"
- End If
- If Not txtOutput.Text = "Territory_" Then
- If randomness.NextDouble > 0.5 Then
- Randomize()
- one_or_zero = 0
- txtOutput.Text &= consonants.ToUpper()(Math.Floor(randomness.NextDouble * 21))
- Else
- Randomize()
- one_or_zero = 1
- txtOutput.Text &= vowels.ToUpper()(Math.Floor(randomness.NextDouble * 5))
- End If
- Randomize()
- For i = 2 To nudStuff.Value
- If (one_or_zero = 1 And i Mod 2 = 0) Or (one_or_zero = 0 And i Mod 2 = 1) Then
- Randomize()
- txtOutput.Text &= consonants(Math.Floor(randomness.NextDouble * 21))
- Else
- Randomize()
- txtOutput.Text &= vowels(Math.Floor(randomness.NextDouble * 5))
- End If
- Next
- Else
- txtOutput.Text &= ID
- ID += 1
- End If
- lstOutputs.Items.Add(txtOutput.Text)
- txtOutput.SelectAll()
- End Sub
- Private Sub cmbPrefix_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbPrefix.SelectedIndexChanged
- nudStuff.Value = 5
- If cmbPrefix.Text = "Territory ID" Then
- lblStuff.Text = "Start:"
- nudStuff.Minimum = 0
- nudStuff.Maximum = 9999
- nudStuff.Value = 0
- ID = 0
- Else
- lblStuff.Text = " Size:"
- nudStuff.Minimum = 2
- nudStuff.Maximum = 16
- End If
- End Sub
- Private Sub nudStuff_ValueChanged(sender As Object, e As EventArgs) Handles nudStuff.ValueChanged
- ID = nudStuff.Value
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement