Skip to content

Instantly share code, notes, and snippets.

@nhooyr
Last active December 6, 2015 13:49
Show Gist options
  • Save nhooyr/ae7634f463acf32c2ea5 to your computer and use it in GitHub Desktop.
Save nhooyr/ae7634f463acf32c2ea5 to your computer and use it in GitHub Desktop.
Public Class Form1
Dim al() As Integer = {5, 6, 5, 71, 34, 43, 1, 2, 5, 3, 2, 3, 5, 6, 1, 9, 8, 7, 7, 5, 2, 3, 4, 5, 54}
Dim i As Integer
Dim l As Integer = al.Length - 1
Private Sub nextClick(sender As Object, e As EventArgs) Handles NextB.Click
If al(i) > al(i + 1) Then
Dim tmp = al(i)
al(i) = al(i + 1)
al(i + 1) = tmp
arrayBox.Text = String.Join(", ", al)
End If
i += 1
If i = l Then
i = 0
l -= 1
End If
End Sub
Private Sub form_load(sender As Object, e As EventArgs) Handles MyBase.Load
arrayBox.Text = String.Join(", ", al)
End Sub
End Class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment