Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on checkBadWords(tString)
- tBadWords = field("badwords")
- tNewString = ""
- tNumOfWords = the number of words in tString
- index = 1
- repeat while index <= tNumOfWords
- if checkWord(tString.word[index]) then
- nothing()
- else
- tNewString = tNewString && tString.word[index]
- end if
- index = 1 + index
- end repeat
- return(tNewString)
- exit
- end
- on checkWord(tWord)
- tBadWords = field("badwords")
- repeat while not isChar(tWord.char[1])
- if the number of char in tWord > 0 then
- delete char 1 of tWord
- end if
- end repeat
- tLen = the number of chars in tWord
- if tLen > 0 then
- repeat while not isChar(tWord.char[the number of chars in tWord])
- delete char (the number of chars in tWord) of tWord
- end repeat
- end if
- index = 1
- repeat while index <= the number of word in tBadWords
- if tWord = tBadWords.word[index] then
- return(1)
- else
- nothing()
- end if
- index = 1 + index
- end repeat
- return(0)
- exit
- end
- on isChar(tChar)
- if charToNum(tChar) >= 65 and charToNum(tChar) <= 90 then
- return(1)
- else
- if charToNum(tChar) >= 97 and charToNum(tChar) <= 122 then
- return(1)
- else
- if charToNum(tChar) >= 48 and charToNum(tChar) <= 57 then
- return(1)
- end if
- end if
- end if
- return(0)
- exit
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement