maddogjbm 0 Newbie Poster

Hi everyone!
I'm new to VB.Net, and I'm having a problem with an assignment.
I have to write a program (console app) that displays four patterns of asterisks (triangles) one below the other. The first two have the square side on the left, and I got those with no problem. But the other two have the square on the right and spaces on the left. I've been working on it for two weeks and haven't had any luck. It's due tonight (I just found this site, so sorry for the crunch) the code I have so far is below.

Module modPatternDisplay
Sub Main()
Dim a, b, c1, c2, d1, d2 As Integer
Dim counterA As Integer = 1
Dim counterB As Integer = 10
Dim counterC1 As Integer = 10
Dim counterC2 As Integer
Dim counterD1 As Integer = 11
Dim counterD2 As Integer = 12

While counterA <= 10
For a = 1 To counterA
Console.Write("*")
Next
Console.WriteLine()
counterA += 1
End While
Console.WriteLine()
While counterB >= 1
For b = 1 To counterB
Console.Write("*")
Next
Console.WriteLine()
counterB -= 1
End While
Console.WriteLine()

While counterC1 >= 1
For c1 = 1 To counterC1
If counterC1 < counterC2 Then
Console.Write("*")
counterC1 -= 1
If counterC2 < counterC1 Then
Console.Write(" ")
counterC2 += 1
End If
If (counterC1 + counterC2) Mod 10 = 0 Then
Console.WriteLine()
End If
End If
Next


End While
Console.WriteLine()
Console.WriteLine()

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.