tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
29
Task/Pangram-checker/VBScript/pangram-checker-1.vbscript
Normal file
29
Task/Pangram-checker/VBScript/pangram-checker-1.vbscript
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
function pangram( s )
|
||||
dim i
|
||||
dim sKey
|
||||
dim sChar
|
||||
dim nOffset
|
||||
sKey = "abcdefghijklmnopqrstuvwxyz"
|
||||
for i = 1 to len( s )
|
||||
sChar = lcase(mid(s,i,1))
|
||||
if sChar <> " " then
|
||||
if instr(sKey, sChar) then
|
||||
nOffset = asc( sChar ) - asc("a") + 1
|
||||
if nOffset > 1 then
|
||||
sKey = left(sKey, nOffset - 1) & " " & mid( sKey, nOffset + 1)
|
||||
else
|
||||
sKey = " " & mid( sKey, nOffset + 1)
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
next
|
||||
pangram = ( ltrim(sKey) = vbnullstring )
|
||||
end function
|
||||
|
||||
function eef( bCond, exp1, exp2 )
|
||||
if bCond then
|
||||
eef = exp1
|
||||
else
|
||||
eef = exp2
|
||||
end if
|
||||
end function
|
||||
2
Task/Pangram-checker/VBScript/pangram-checker-2.vbscript
Normal file
2
Task/Pangram-checker/VBScript/pangram-checker-2.vbscript
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
wscript.echo eef(pangram("a quick brown fox jumps over the lazy dog"), "is a pangram", "is not a pangram")
|
||||
wscript.echo eef(pangram(""), "is a pangram", "is not a pangram")"
|
||||
Loading…
Add table
Add a link
Reference in a new issue