Jump to content

Pangram checker: Difference between revisions

Added FreeBASIC
(→‎Using bitmask: Clarify environment restriction in a whole sentence)
(Added FreeBASIC)
Line 1,110:
The five boxing wizards jumped quickly.
T</pre>
 
=={{header|FreeBASIC}}==
<lang freebasic>' FB 1.05.0 Win64
 
Function isPangram(s As Const String) As Boolean
Dim As Integer length = Len(s)
If length < 26 Then Return False
Dim p As String = LCase(s)
For i As Integer = 97 To 122
If Instr(p, Chr(i)) = 0 Then Return False
Next
Return True
End Function
 
Dim s(1 To 3) As String = _
{ _
"The quick brown fox jumps over the lazy dog", _
"abbdefghijklmnopqrstuVwxYz", _ '' no c!
"How vexingly quick daft zebras jump!" _
}
 
For i As Integer = 1 To 3:
Print "'"; s(i); "' is "; IIf(isPangram(s(i)), "a", "not a"); " pangram"
Print
Next
 
Print
Print "Press nay key to quit"
Sleep</lang>
 
{{out}}
<pre>
'The quick brown fox jumps over the lazy dog' is a pangram
 
'abbdefghijklmnopqrstuVwxYz' is not a pangram
 
'How vexingly quick daft zebras jump!' is a pangram
</pre>
 
=={{header|Go}}==
<lang go>package main
9,490

edits

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