- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
First thought, holy ...., Second thought, time to leAve nOw = true Its' only gonna get worse
Admin
And then imagine all those permutations of PoSiTiVe and NeGaTiVe.....
Admin
Enterprise-grade code would do it like this:
(1) Read a file of words that the user might type in. Suffix each word with a flag saying whether the word means 'true' or 'false'. (2) For each word, generate all possible combinations of upper and lower case letters. (3) Throw the combinations into an efficient data type, say, a map. (4) Look up the user input in the map. Extract flag. (5) Throw the map away to save memory. (6) Profit!
Add patterns and buzzwords as required.
Obviously the file in (1) is specified to be in CSV format so it can be generated from Excel. Sadly the spec never mentions the legal values for the flag, but don't worry, we will soon have some code that we can re-use...
Admin
I believe have seen it enough places, I am surprised I couldn't find anything on tvtropes.org
Admin
Brillant (said Paula)