I have read a previous post reguarding this topic and though it was somewhat helpful, my problem is a bit more difficult. I'm to make four different triangles of asterisks that show one below the other.
*
**
***
****
*****
******
*******
********
*********
**********
**********
*********
********
*******
******
*****
****
***
**
*
**********
*********
********
*******
******
*****
****
***
**
*
*
**
***
****
*****
******
*******
********
*********
**********
however this is in a windows form. i have to use two buttons one for printing this when the size is between 3 and 15. and the other buttono is to clear all of these..
this isnt working right andim not sure what ive done wrong. here is what i have so far:
Public Class Form1
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
'pattern A
Dim i As Integer
For i = 1 To 10
TextBox1.Text = TextBox1.Text & String(i, "*") & vbCrLf
Next
'pattern B
Dim i As Integer
For i = 10 To 1 Step -1
TextBox1.Text = TextBox1.Text & String(i, "*") & vbCrLf
Next
'pattern C
Dim Asterisk As String
Dim outer As Integer
Dim inner As Integer
For outer = 10 To 1 Step -1
Asterisk = Space(10 - outer)
For inner = 1 To outer
Asterisk = Asterisk & "*"
Next
Next
'pattern D
Dim Asterisk As String
Dim outer As Integer
Dim inner As Integer
For outer = 1 To 10
Asterisk = Space(10 - outer)
For inner = 1 To outer
Asterisk = Asterisk & "*"
Next
Next
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub
End Class
any help will be greatly appreciated