Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

be a bad dad 4

Status
Not open for further replies.

TheRambler

Programmer
Jan 23, 2003
523
BO
Actually the subject of this thread doesn't sound as bad as its literal meaning, if you didn't notice those words can be played on a musical instrument.

Can you think of a better-sounding phrase?

This puzzle is susceptible to SQLing!
Some words you can use: bag, dead, beef, bed, face, babe, cage, egg, ace and so on, you can figure out the rest.

Download Pianito MicroStudio if you want to test your creativity.

 
If headline style grammar is allowed:

A dad fed a babe dead beef, added cabbage. Egad! Babe faced dad, gagged.
 
I like that one

Go not to cats for advice for they will just walk over the keyboard
 
Wow RodKnowlton! Good one! Did you invent it yourself?

Welcome to the wordplay forum.

-------------------------------------
It is better to have honor than a good reputation.
(Reputation is what other people think about you. Honor is what you know about yourself.)
 
Someone besides me is using a dictionary. :)


In a town where vigilantes kills vandals while they sleep at night:

Deface a facade, be dead abed!

-------------------------------------
It is better to have honor than a good reputation.
(Reputation is what other people think about you. Honor is what you know about yourself.)
 
In honour of computers

Ada bade Babbage cadge cafe cabbage
"Garbage" gaffed Babbage
Ada gagged Babbage
"Babbage bad" added Ada

Go not to cats for advice for they will just walk over the keyboard
 
What about "Garbage"? I think Rs can't be played on a musical instrument, but I might be wrong because I am not an expert.

To get a list of available words, I would use a query like this in Visual FoxPro, but I don't have a dictionary yet:

SELECT word ;
FROM dictionary ;
WHERE LEN(CHRTRAN(TRIM(word),"ABCDEFG",""))=0

Does anybody know how many words this query returns?
 
drat 'n' bother

Sorry, missed that 'r'

Ada bade Babbage cadge cafe cabbage
"Baggage" gaffed Babbage
Ada gagged Babbage
"Babbage bad" added Ada

I'm not that old, just a late devloper...

Go not to cats for advice for they will just walk over the keyboard
 
What I used was

[tt]SELECT Word
FROM Dictionary
WHERE Word NOT LIKE '%[^a-f]%'
ORDER BY WordLength[/tt]

-------------------------------------
It is better to have honor than a good reputation.
(Reputation is what other people think about you. Honor is what you know about yourself.)
 
Hmmm, very interesting...
I could use those wildcard characters [^], too bad we only get percent sign and underscore.
What I don't understand is the double negative, wouldn't WHERE Word LIKE '%[a-g]%' be enough?

Anyway, seems to me there aren't many good "musical words" to choose from, so far I only like the sound of defaced and baggage.
 
wouldn't WHERE Word LIKE '%[a-g]%' be enough?

No, because that would simply select every word that has any of those letters... not excluding words that also have other letters. That would, for example, select 'xylophone' because there is an e in it.

[^a-f] means, not in the list of letters A through F. So, find all the words that have any letter which is not A through F. Then, take the opposite of that set. The result is the set of words which do not, not contain only the letters ABCDEF.


-------------------------------------
It is better to have honor than a good reputation.
(Reputation is what other people think about you. Honor is what you know about yourself.)
 
I would submit to you E² that you seem to have neglected the G... Without the G there would be no Rock and Roll.

~Thadeus
 
Thanks for the explanation ESquared, SQL Server syntax is more concise, but I find WHERE LEN(CHRTRAN(TRIM(word),"ABCDEFG",""))=0 easier to understand (to me, at least):

TRIM() removes leading and trailing blanks
CHRTRAN(word,"ABCDEFG","") replaces each character in word that matches a character of "ABCDEFG" with the corresponding character of the third expression, which is nothing in this case.
And LEN() returns the number of characters that remain, if none then that's a word we were looking for.

I still like SQL Server's wildcard characters though. Wordplay is fun, and is a good way to learn some algorithms. Who knows, maybe soundex, metaphone or double-metaphone started as wordplay...
 
TheRambler...nice explanation for those who don't know...now if I only had a dictionary MS/SQL database.

Where does one get one (if they're not too pricey)?

 
Thanks TheRambler

Did you strip the html then insert into a database?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top