Jump to content

Pangram checker: Difference between revisions

(Consolidate BASICs)
(→‎{{header|Commodore BASIC}}: Add implementation.)
Line 657:
NEXT text%
=FALSE</pre>
 
==={{header|Commodore BASIC}}===
<syntaxhighlight lang="gwbasic">10 rem detect model for title display
20 mx=peek(213): if mx=21 or mx=39 or mx=79 then 50:rem pet, vic, c64
30 mx=peek(238): if mx=39 or mx=79 then 50: rem c128
40 mx=39:color 4,1:rem assume plus/4 or c-16
50 if mx=21 then poke 36879,30:rem fix color on vic-20
60 print chr$(147);chr$(14);chr$(18);"**";:for i=2 to (mx-15)/2:print " ";:next
70 print "Pangram Checker";
80 for i=(mx-15)/2+16 to mx-2: print " ";: next: print "**"
100 read s$
110 if len(s$)=0 then end
120 gosub 1000:print
130 print "'"s$"' is";
140 if p=0 then print " not";
150 print " a pangram."
160 goto 100
500 data "The quick brown fox jumps over the lazy dog."
510 data "The quick brown fox jumped over the lazy dog."
520 data "The five boxing wizards jump quickly."
530 data
900 rem pangram checker
1000 if f=0 then f=1:dim seen(25),a(2):a(0)=65:a(1)=97:a(2)=193:goto 1020
1010 for i=0 to 25:seen(i)=0:next
1020 for i=1 to len(s$)
1030 : c=asc(mid$(s$,i))
1040 : for a = 0 to 2
1050 : if c>=a(a) and c<=a(a)+25 then seen(c-a(a))=seen(c-a(a))+1
1060 : next a
1070 next i
1080 p=-1
1090 for i=0 to 25
1100 : if seen(i)=0 then p=0:i=25
1110 next i
1120 return</syntaxhighlight>
 
{{Out}}
<pre>** Pangram Checker **
 
 
'The quick brown fox jumps over the lazy dog.' is a pangram.
 
'The quick brown fox jumped over the lazy dog.' is not a pangram.
 
'The five boxing wizards jump quickly.' is a pangram.
 
ready.</pre>
 
==={{header|FreeBASIC}}===
1,481

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.