|
Post by Azan on Aug 27, 2005 12:22:11 GMT -5
Graphics 300,300,0,2 SetBuffer BackBuffer()
Dim a(7,5) For x=0 To 7 ;have each value = 0 For y=0 To 5 a(x,y)=0 Next Next a(0,0)=3 ;make this one = 3 a(2,2)=1 ;make this one = 1 While Not KeyHit(1) Flip Cls prin() Wend End
Function prin() Locate 0,0 ;print all the values For y=0 To 5 Print a(0,y)+" "+a(1,y)+" "+a(2,y)+" "+a(3,y)+" "+a(4,y)+" "+a(5,y)+" "+a(6,y)+" "+a(7,y) Next End Function post any questions you have here.
|
|
|
Post by Azan on Aug 28, 2005 12:04:06 GMT -5
another demo, you can move the 1 around with the arrow keys Graphics 300,300,0,2 SetBuffer BackBuffer() Global z,q Dim a(7,5) For x=0 To 7 ;have each value = 0 For y=0 To 5 a(x,y)=0 Next Next While Not KeyHit(1) Flip Cls prin() Wend End
Function prin() Locate 0,0 For y=0 To 5 ;reset all to 0 For x=0 To 7 a(x,y)=0 Next Next If KeyHit(200) And q>0 Then q=q-1 EndIf If KeyHit(208) And q<5 Then q=q+1 EndIf If KeyHit(203) And z>0 Then z=z-1 EndIf If KeyHit(205) And z<7 Then z=z+1 EndIf a(z,q)=1 For y=0 To 5 Print a(0,y)+" "+a(1,y)+" "+a(2,y)+" "+a(3,y)+" "+a(4,y)+" "+a(5,y)+" "+a(6,y)+" "+a(7,y) Next End Function
|
|