angka muter - by2 = by2 - 1 mode = 2 ElseIf y + dy < by1...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Private Sub Form_click() Dim temp(100, 100) Cls ct = 0 n = 5 x = 1 y = 1 dx = 1 dy = 0 dc = 1 bx1 = 1 by1 = 1 bx2 = n by2 = n mode = 2 For i = 1 To n For j = 1 To n temp(j, i) = 0 Next j Next i For i = 1 To n * n If x + dx > bx2 And mode = 2 Then dx = 0 dy = 1 bx2 = bx2 - 1 mode = 1 ElseIf x + dx < bx1 And mode = 2 Then dx = 0 dy = -1 bx1 = bx1 + 1 mode = 1 ElseIf y + dy > by2 And mode = 1 Then dx = -1 dy = 0
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: by2 = by2 - 1 mode = 2 ElseIf y + dy < by1 And mode = 1 Then dx = 1 dy = 0 by1 = by1 + 1 mode = 2 x = x + 1 y = y + 1 End If If ct + dc > n Or ct + dc < 1 Then dc = -dc End If ct = ct + dc temp(x, y) = ct x = x + dx y = y + dy Next i For i = 1 To n For j = 1 To n Print temp(j, i); Next j Print Next i End Sub...
View Full Document

This note was uploaded on 09/30/2010 for the course PROGRAMMIN 52635 taught by Professor Agustinus during the Winter '05 term at St. Borromeo.

Ask a homework question - tutors are online