Kamis, 12 November 2009

Contoh Penggunaan For, Next, Locate, Print pada turbo basic

Berikut ini adalah contoh program turbo basic dengan penggunaan For, Next,delay.


cls
Color 14
locate 5,23 : print " Program By: Victor Indra Gunawan "
color 25
locate 19,27 : print " Tekan Enter Untuk Keluar "

Color 15
locate 8,33 : print "============="
locate 9,33 : print "= ="
locate 10,33: print "= ="
locate 11,33: print "= ="
locate 12,33: print "= ="
locate 13,33: print "= ="
locate 14,33: print "= ="
Locate 15,33: print "= ="
locate 16,33: print "============="
color 14

for a=1 to 5 step 2
locate 10,35+a

print a
delay 0.5
next a

for b=2 to 5 step 2
locate 11,35+b
delay 0.5
print b
next b

for c=1 to 5 step 2
locate 12,35+c
delay 0.5
print c
next c

for d=2 to 5 step 2
locate 13,35+d
delay 0.5
print d
next d

for e=1 to 5 step 2
locate 14,35+e
delay 0.5
print e
next e
end

1 komentar: