用QBASIC编制“霓虹灯广告牌”
编程语言和运行环境:QBASIC
5 cls:locate 10,25:print ”霓虹灯广告牌”
10 screen 8
20 for i=1 to 15
30 for m=1 to 2
40 if m=2 then a$=” ”:goto 55
45 a$=chr$(177)
50 color i,0
55 if i mod 3=0 then x1=71:x2=10:k=-1:goto 70
60 if i mod 3=2 then 80
65 x1=10:x2=71:k=1
70 for x=x1 to x2 step k
75 if i mod 3=2 then 90
80 for y=5 to 17
85 if i mod 3=2 then 65
90 if x=12 or x=13 or x=16 or x=17 then if y<12 or y>15 then 400
100 if x=14 or x=15 then if y<10 or y>13 then 400
110 if x=20 or x=21 or x=28 or x=29 or x=36 or x=37 then 400
120 if x=44 or x=45 or x=52 or x=53 or x=64 or x=65 then 400
130 if x>23 and x<28 then if y>6 and y<10 then 400
135 if x>23 and x<28 then if y>11 and y<16 then 400
140 if x>31 and x<36 then if y<16 then 400
150 if x=40 or x=41 then if y>6 and y<16 then 400
160 if x=42 or x=43 then if y>8 and y<12 then 400
170 if x=48 or x=49 then if y>6 and y<16 then 400
180 if x=56 or x=57 or x=60 or x=61 then if y<7 or y>10 then 400
185 if x=58 or x=59 then if y<9 or y>12 then 400
190 if x>67 and x<72 then if y>6 and y<10 or y>11 and y<16 then 400
300 color i,0
310 locate y,x:print a$
400 if i mod 3=2 then 415
405 next y
410 if i mod 3=2 then 425
415 next x
420 if i mod 3=2 then 405
425 for t=1 to 20000:next t
430 next m,i
440 end