Source Code



Say Love By VB.Net

  • M. Taufik
  • Mar 28' 14
  • VB.NET
  • 377
  • 58
  • United States

Module SayLove
Sub main()
Dim rows, point, limit As Integer
Dim love, love1, color As String
Dim counter As Integer = 20
Dim repeat As String = "Y"
Dim say() As String = {"Say", "Love", "Colourfully", "by", "VB.Net", "!!!!!"}
        limit = 25
        rows = 1

        For i = 0 To say.GetUpperBound(0)
            If i = 0 Then
                Console.ForegroundColor = ConsoleColor.Red
                Console.Write(say(i))
                Console.ResetColor()
            ElseIf i = 1 Then
                Console.ForegroundColor = ConsoleColor.Yellow
                Console.Write(" " & say(i))
                Console.ResetColor()
            ElseIf i = 2 Then
                Console.ForegroundColor = ConsoleColor.Green
                Console.Write(" " & say(i))
                Console.ResetColor()
            ElseIf i = 3 Then
                Console.ForegroundColor = ConsoleColor.Blue
                Console.Write(" " & say(i))
                Console.ResetColor()
            ElseIf i = 4 Then
                Console.ForegroundColor = ConsoleColor.Cyan
                Console.Write(" " & say(i))
                Console.ResetColor()
            Else
                Console.ForegroundColor = ConsoleColor.Magenta
                Console.Write(" " & say(i))
                Console.ResetColor()
            End If
        Next

        Console.WriteLine()
        Console.WriteLine()
up:
        Console.Write("Select The Symbol of Love ( * / @ / # / & / % / + ) = ")
        love1 = Console.ReadLine()
        Do Until love1 = "*" Or love1 = "@" Or love1 = "#" Or love1 = "&" Or love1 = "%" Or love1 = "+"
            Console.ForegroundColor = ConsoleColor.Red
            Console.WriteLine("The Symbol is Wrong!!!")
            Console.ResetColor()
            Console.Write("Select The Symbol of Love ( * / @ / # / & / % / + ) = ")
            love1 = Console.ReadLine()
        Loop

        love = " " & love1
        Console.Write("Select The Colour of Love (Red/Yellow/Green/Blue/Cyan/Magenta/White) = ")
        color = Console.ReadLine().ToLower
        Do Until color = "blue" Or color = "green" Or color = "yellow" Or color = "red" Or
            color = "magenta" Or color = "cyan" Or color = "white"
            Console.ForegroundColor = ConsoleColor.Red
            Console.WriteLine("The Colour is Wrong!!!")
            Console.ResetColor()
            Console.Write("Select The Colour of Love (Red/Yellow/Green/Blue/Cyan/Magentha/White) = ")
            color = Console.ReadLine().ToLower
        Loop

        Select Case color
            Case "blue"
                Console.ForegroundColor = ConsoleColor.Blue
            Case "green"
                Console.ForegroundColor = ConsoleColor.Green
            Case "cyan"
                Console.ForegroundColor = ConsoleColor.Cyan
            Case "yellow"
                Console.ForegroundColor = ConsoleColor.Yellow
            Case "red"
                Console.ForegroundColor = ConsoleColor.Red
            Case "magenta"
                Console.ForegroundColor = ConsoleColor.Magenta
            Case Else
                Console.ForegroundColor = ConsoleColor.White
        End Select

rows = 1
While rows <= counter
            If rows = 2 Then
                point = 1
                While point <= limit
                    If point <= 2 Or (point >= 5 And point <= 7) Or
                     point = 11 Or (point >= 15 And point <= 17) Or
                    (point >= 20 And point <= 23) Then
                        Console.Write(" ")
                        point += 1
                    Else
                        Console.Write(love)
                        point += 1
                    End If
                End While
                Console.WriteLine()
                rows += 1

ElseIf rows = 3 Then
                point = 1
                While point <= limit
                    If point <= 2 Or (point >= 5 And point <= 6) Or
                        (point >= 16 And point <= 17) Or
                        (point >= 20 And point <= 23) Then
                        Console.Write("  ")
                        point += 1
                    Else
                        Console.Write(love)
                        point += 1
                    End If
                End While
                Console.WriteLine()
                rows += 1
            ElseIf rows >= 4 And rows <= 6 Then
                point = 1
                While point <= limit
                    If point <= 2 Or (point >= 5 And point <= 6) Or
                        (point >= 16 And point <= 17) Or
                        (point >= 20 And point <= 23) Then
                        Console.Write("  ")
                        point += 1
                    Else
                        Console.Write(love)
                        point += 1
                    End If
                End While
                Console.WriteLine()
                rows += 1
            ElseIf rows = 7 Then
                point = 1
                While point <= limit
                    If point <= 2 Or (point >= 5 And point <= 7) Or
                        (point >= 15 And point <= 17) Or
                       (point >= 20 And point <= 23) Then
                        Console.Write("  ")
                        point += 1
                    Else
                        Console.Write(love)
                        point += 1
                    End If
                End While
                Console.WriteLine()
                rows += 1
            ElseIf rows = 8 Then
                point = 1
                While point <= limit
                    If point <= 2 Or (point >= 5 And point <= 8) Or
                        (point >= 14 And point <= 17) Then
                        Console.Write("  ")
                        point += 1
                    Else
                        Console.Write(love)
                        point += 1
                    End If
                End While
                Console.WriteLine()
                rows += 1
            ElseIf rows = 9 Then
                point = 1
                While point <= limit
                    If point <= 2 Or (point >= 5 And point <= 9) Or
                        (point >= 13 And point <= 17) Then
                        Console.Write("  ")
                        point += 1
                    Else
                        Console.Write(love)
                        point += 1
                    End If
                End While
                Console.WriteLine()
                rows += 1
            ElseIf rows = 10 Then
                point = 1
                While point <= limit
                    If point <= 2 Or (point >= 5 And point <= 10) Or
                    (point >= 12 And point <= 18) Or point = 25 Then
                        Console.Write("  ")
                        point += 1
                    Else
                        Console.Write(love)
                        point += 1
                    End If
                End While
                Console.WriteLine()
                rows += 1
                Console.ResetColor()
                Console.ForegroundColor = ConsoleColor.Yellow
            ElseIf rows = 13 Then
                point = 1
                While point <= limit
                    If point <= 2 Or (point >= 5 And point <= 8) Or
                    (point >= 11 And point <= 12) Or (point >= 15 And point <= 16) Or
                    (point >= 19 And point <= 21) Or point = 25 Then
                        Console.Write("  ")
                        point += 1
                    Else
                        Console.Write(love)
                        point += 1
                    End If
                End While
                Console.WriteLine()
                rows += 1
            ElseIf rows = 14 Or rows = 15 Then
                point = 1
                While point <= limit
                    If point <= 2 Or (point >= 5 And point <= 8) Or
                    (point >= 11 And point <= 12) Or point = 16 Or
                    (point >= 19 And point <= 20) Or point = 23 Then
                        Console.Write("  ")
                        point += 1
                    Else
                        Console.Write(love)
                        point += 1
                    End If
                End While
                Console.WriteLine()
                rows += 1
            ElseIf rows = 16 Or rows = 17 Then
                point = 1
                While point <= limit
                    If point <= 2 Or (point >= 5 And point <= 8) Or
                    (point >= 11 And point <= 12) Or
                    (point >= 19 And point <= 20) Then
                        Console.Write("  ")
                        point += 1
                    Else
                        Console.Write(love)
                        point += 1
                    End If
                End While
                Console.WriteLine()
                rows += 1
            ElseIf rows = 18 Then
                point = 1
                While point <= limit
                    If point <= 2 Or (point >= 5 And point <= 8) Or
                    (point >= 11 And point <= 12) Or point = 15 Or
                    (point >= 19 And point <= 20) Or point = 23 Then
                        Console.Write("  ")
                        point += 1
                    Else
                        Console.Write(love)
                        point += 1
                    End If
                End While
                Console.WriteLine()
                rows += 1
            ElseIf rows = 19 Then
                point = 1
                While point <= limit
                    If point <= 2 Or (point >= 7 And point <= 8) Or
                    (point >= 11 And point <= 12) Or point = 15 Or
                    (point >= 19 And point <= 20) Or point = 23 Then
                        Console.Write("  ")
                        point += 1
                    Else
                        Console.Write(love)
                        point += 1
                    End If
                End While
                Console.WriteLine()
                rows += 1
            ElseIf rows = 20 Then
                point = 1
                While point <= limit
                    If point <= 2 Or (point >= 7 And point <= 8) Or
                    (point >= 11 And point <= 12) Or (point >= 15 And point <= 16) Or
                    (point >= 19 And point <= 20) Or point = 23 Then
                        Console.Write("  ")
                        point += 1
                    Else
                        Console.Write(love)
                        point += 1
                    End If
                End While
                Console.WriteLine()
                rows += 1
            Else
                point = 1
                While point <= limit
                    Console.Write("  ")
                    point += 1
                End While
                Console.WriteLine()
                rows += 1
            End If
        End While
        Console.ResetColor()
        Console.WriteLine()
        Console.Write("Do You Want to Repeat (Y/N) = ")
        repeat = Console.ReadLine().ToLower
        While repeat <> "y" And repeat <> "n"
            Console.ForegroundColor = ConsoleColor.Red
            Console.WriteLine("Only Y or N ....!!!!")
            Console.ResetColor()
            Console.Write("Do You Want to Repeat (Y/N) = ")
            repeat = Console.ReadLine().ToLower
        End While
        If repeat = "y" Then
            GoTo up
        End If
        Console.WriteLine()
        Console.WriteLine("Good Bye....!!!")
    End Sub
End Module

  • Tags :
comments powered by Disqus

Related Code

Search Data Array (Static)

List Data Student By Array Multidimensi

Find The Maximun, Minimum and Average by Array Season II

Find The Maximun, Minimum and Average by Array

Know the number of odd or even !

Check two files are equal

Define binary type

Coloring Cells in a DBGrid

Coloring Cells in a StringGrid

Disable the Close X button on a Form



Category