Discuss Scratch

dr1STEAM
Scratcher
8 posts

Letters

How do i check for letters?
if <(answer) has [letters]> then
say [NO!]
end
CT-7569
Scratcher
100+ posts

Letters

Do you mean checking for a specific letter or checking for letters in general, as -Valtren- below showed?
To check for a specific letter, use this block:
<[apple] contains [a] ? :: operators>

To check for letters in general, use this:
((answer) / (1)) = (answer) //returns true if it's a number; false if it's a string

Last edited by CT-7569 (Dec. 8, 2022 15:03:25)

-Valtren-
Scratcher
1000+ posts

Letters

the following should work:
first, make a list that contains all the units

then check whether the first letter of the text is contained in a list. it will be likely a number if it does.

this returns true, but if you put in a letter it would return false

Powered by DjangoBB