; Arrays: one name, lots of values Graphics 640, 480 SeedRnd MilliSecs() Dim height(15) ; 16 boxes: height(0) to height(15) For i = 0 To 15 height(i) = Rand(60, 300) Next ClsColor 30, 20, 60 Cls ; draw the buildings, each 40 pixels wide, standing on the bottom of the screen For i = 0 To 15 Color 40 + i * 5, 40, 80 Rect i * 40, 480 - height(i), 38, height(i) ; lit windows Color 255, 220, 120 For wy = 480 - height(i) + 10 To 470 Step 20 If Rand(1, 3) = 1 Then Rect i * 40 + 8, wy, 8, 8 If Rand(1, 3) = 1 Then Rect i * 40 + 22, wy, 8, 8 Next Next ; find the tallest building tallest = 0 For i = 1 To 15 If height(i) > height(tallest) Then tallest = i Next labelX = tallest * 40 + 19 If labelX < 40 Then labelX = 40 ; keep the label on the screen If labelX > 600 Then labelX = 600 Color 255, 255, 255 Text labelX, 480 - height(tallest) - 20, "Tallest!", True Text 10, 10, "Press any key" WaitKey End