sayı tahmini programı *
-
hello world'un akabinde yazilan if statement'lar ve goto komutlarini ogreten unutulmaz program:
1 rem number guessing game
2 print "{clr/home}"
5 input "enter upper limit for guess ";li
10 nm = int(li*rnd(1))+1
15 cn = 0
20 print "i've got the number." : print
30 input "what's your guess "; gu
35 cn = cn + 1
40 if gu > nm then print "my number is lower." : print : goto 30
50 if gu < nm then print "my number is higher.": print : goto 30
60 print "great! you got my number"
65 print "in only"; cn ;"guesses." : print
70 print "do you want to try another (y/n) ?";
80 get an$ : if an$ = "" then 80
90 if an$ = "y" then 2
100 if an$ <> "n" then 70
110 end
commodore 64 kullanim kilavuzundan alinmistir.
http://www.zimmers.net/cbmpics/cbm/c64/c64ug.txt -
ekşi sözlük kullanıcılarıyla mesajlaşmak ve yazdıkları entry'leri
takip etmek için giriş yapmalısın.
hesabın var mı? giriş yap