Advertisement
31ph4n70m

Funny_Words_Generator.vb

Dec 17th, 2019
643
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.16 KB | None | 0 0
  1. 'VisualBasic solution to codeabbey challenge 72
  2. Imports System
  3.  
  4. Module compiler
  5.    
  6.     Sub Main()
  7.         Dim inp1() As Integer = {22, 1838911}
  8.         Dim inp2() As Integer = {3, 5, 5, 4, 6, 8, 8, 5, 3, 5, 4, 7, 6, 4, 3, 5, 5, 7, 7, 5, 8, 6}
  9.         Dim con() As String = {"b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "r", "s", "t", "v", "w", "x", "z"}
  10.         Dim vow() As String = {"a", "e", "i", "o", "u"}
  11.         Dim a, i, aa, cc, mm, xn, li As Integer
  12.         aa = 445
  13.         cc = 700001
  14.         mm = 2097152
  15.         xn = inp1(1)
  16.         li = 0
  17.         Dim rsp(inp1(0)-1) As String
  18.         For a = 0 To inp2.Length-1
  19.             Dim wl As Integer = inp2(a)
  20.             Dim word As String = ""
  21.             For i = 1 To wl
  22.                 xn = (aa*xn + cc) MOD mm
  23.                 If (i MOD 2 = 0) Then
  24.                     li = xn MOD 5
  25.                     word = word + vow(li)
  26.                 Else
  27.                     li = xn MOD 19
  28.                     word = word + con(li)
  29.                 End If
  30.             Next
  31.             rsp(a) = word
  32.         Next
  33.         Console.WriteLine (String.Join(" ", rsp))
  34.     End Sub
  35. end Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement