home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1986 January / Ahoy_Magazine_86-01_1986_Double_L.d64 / talking clock (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1986-01-01  |  2.2 KB  |  90 lines

  1. 1 print"[147]"
  2. 2 print  spc(7)"c64time"
  3. 3 print spc(9)"by"
  4. 4 print spc(2)"isaac michalowski"
  5. 5 print spc(6)"12/09/83"
  6. 6 print " mod. for the c64/128"
  7. 7 print spc(9)"by"
  8. 8 print spc(2)"morton kevelson"
  9. 9 print spc(6)" 5/17/85"
  10. 10 forx=1to800:nextx
  11. 14 print"[147]"
  12. 15 dima$(6)
  13. 20 print "time set[146]"
  14. 25 print"24 hour format"
  15. 30 print"enter time in the"
  16. 35 print"following manner"
  17. 40 print"[158]hh=hours"
  18. 44 print"mm=miutes"
  19. 45 print"ss=seconds"
  20. 50 print"[158]hhmmss"
  21. 55 inputa$
  22. 56 ifmid$(a$,7,7)=>"0"then3050
  23. 60 if  a$>"235959"goto3000
  24. 65 ti$=a$
  25. 70 print spc(8)"running"
  26. 120 sp(1)= 31 :sp(2)= 24
  27. 130 drt=37136:ddr=37138:dfl=37149:dcb=37148: rem for vic-20
  28. 135 rem: drt=56577:ddr=56579:dfl=56578:dcb=56576:rem for c-64/128
  29. 140 poke ddr,127
  30. 150 a=peek(dcb)and 15:rem for vic-20
  31. 155 rem: a=peek(dfl)or 4:rem for c-64/128
  32. 160 poke(dcb),160 or a:rem for vic-20
  33. 165 rem: poke(dfl),a:rem for c-64/128
  34. 170 rem: gosub 3110:rem for c-64/128
  35. 200 rem**strip time**
  36. 210 a$=left$(ti$,2)
  37. 220 a=val(a$)
  38. 230 rem**strip minutes**
  39. 240 b$=mid$(ti$,3,2)
  40. 250 b=val(b$)
  41. 260 z=0
  42. 261 t=0
  43. 265 if a<21 then z=1:goto330
  44. 266 t=0
  45. 270 if a=21 then a1=1:t=a:goto320
  46. 280 if a=22 then a1=2:t=a:goto320
  47. 290 if a=23 then a1=3:t=a:goto320
  48. 320 a=20
  49. 330 rem**check minutes**
  50. 340 if b=0  goto 1000
  51. 350 if b<10 then b1=b:b=0:goto1040
  52. 360 if b=50 then b=23:goto1080
  53. 370 if b>50 then b1=b-50:b=23:goto1040
  54. 380 if b=40 then b=22:goto1080
  55. 390 if b>40 then b1=b-40:b=22:goto1040
  56. 400 if b=30 then b=21:goto1080
  57. 410 if b>30 then b1=b-30:b=21:goto1040
  58. 420 if b>20 then b1=b-20:b=20:goto1040
  59. 430 goto 1080
  60. 1000 rem**top of hour**
  61. 1010 if t<21anda<21then sp(3)=a:sp(4)=29:sp(5)=33:n=3:goto2000
  62. 1020 sp(3)=a:sp(4)=a1:sp(5)=29:sp(6)=33:n=4:goto2000
  63. 1030 goto 2000
  64. 1040 rem**sound format minutes**
  65. 1050 if z=1 then sp(3)=a:sp(4)=27:sp(5)=b:sp(6)=b1:sp(7)=28:n=5:goto2000
  66. 1060 sp(3)=a:sp(4)=a1:sp(5)=27:sp(6)=b  :sp(7)=b1:sp(8)=28:n=6
  67. 1070 goto 2000
  68. 1080 rem**sound format minutes10,20,30,40,50 only**
  69. 1090 if z=1 then sp(3)=a:sp(4)=27:sp(5)=b:sp(6)=28:n=4:goto 2000
  70. 1100 sp(3)=a:sp(4)=a1:sp(5)=27:sp(6)=b:sp(7)=28:n=5:goto 2000
  71. 2000 rem**speak!!**
  72. 2010 for x=1 to n+2
  73. 2020 if peek(drt)>127 goto 2020
  74. 2030 poke drt,sp(x)
  75. 2035 gosub3100
  76. 2040 next x
  77. 2050 rem**top of minute**
  78. 2060 c$=right$(ti$,2)
  79. 2070 c=val(c$)
  80. 2080 if c=00 goto 200
  81. 2090 goto 2060
  82. 3000 rem**error message**
  83. 3010 print"[147]time set is greater   than 235959"
  84. 3030 fore=1to3500:nexte
  85. 3040 print"[147]":goto30
  86. 3050 print"[147]enter only 6 digits":goto3020
  87. 3100 rem poke dcb,peek(dcb)and251:rem for c-64/128
  88. 3110 rem poke dcb,peek(dcb)or4:rem for c-64/128
  89. 3120 rem return:rem for c-64/128
  90.