41
5
Write a quine that consists of real English words separated by single spaces. A "word" is defined as a string containing only lowercase and uppercase letters (/[a-zA-Z]+/
in regex). To be "real" your word must be recognized by the official Scrabble dictionary.
I'm using the Scrabble dictionary since it gives a definitive answer on what is and isn't valid. There are too many gray areas with a normal dictionary. Note that "A" and "I" (not to mention "quine") are not valid scrabble words.
Since writing a quine only using letters and spaces is close to impossible in most programming languages, you have the option to replace the single spaces between words with a character of your choice. You also have the option to append characters to the front of the first word and the end of the last word. These added characters may be anything (including newlines and non-ASCII) except letters (a-z, A-Z). There is a penalty for adding them though (see Scoring.)
Details
- As usual, the quines may not read or access their own source code. (I'd say that HQ9+'s Q command violates this.)
- Output should go to stdout or a similar alternative. There is no input.
- The words do not need to be capitalized correctly. They can have caps and lowercase anywhere. The sequence of words does not need to make any sense.
- No word may be used more than 3 times in your program. Differently capitalized words are still the same word (e.g. 'DOG', 'dog', and 'dOg' are all the same word).
- Using languages like PHP or HTML that can just cat out their contents is considered a trivial loophole and is not allowed.
- The program must contain at least one word.
Scoring
Your score is the number of "real words" in your program plus these penalties:
- +1 for every space that was replaced with another character
- nn for every n characters you added before the first word (yes, that's n to the power n)
- nn for every n characters you added after the last word
For example, the program
We all LIKE PROgraMmING
would score 4 because it contains 4 words; no characters were added or replaced any spaces. It's output would of course be We all LIKE PROgraMmING
.
The program
!We@all LIKE#PROgraMmING- =
would score 4 + 2 + 1 + 27 = 34; 4 for the words, 2 for the replaced spaces, 1 for the !
at the front, and 27 for the - =
at the end. It's output would of course be !We@all LIKE#PROgraMmING- =
.
The lowest score wins. Tiebreaker goes to the answer with the fewest penalty points. If there's still a tie the highest voted answer wins.
1Does that dictionary also exist as a list? That would be a lot more helpful to browse through than having to check each word individually. – Martin Ender – 2015-02-26T09:54:43.490
16Shakespeare anyone? – dwana – 2015-02-26T09:57:25.267
2
@MartinBüttner, https://scrabblehelper.googlecode.com/svn-history/r20/trunk/ScrabbleHelper/src/dictionaries/sowpods.txt
– Peter Taylor – 2015-02-26T10:23:59.173Is "too hard" a valid downvote reason? Because I feel this is too hard. – John Dvorak – 2015-02-26T11:10:23.277
1@JanDvorak I don't think so... The fact that I can't write anything like this shouldn't make other people see this as a bad question, it's a valid, although pretty difficult, challenge, is it not? – rorlork – 2015-02-26T11:13:03.187
7I'm still interested in a Shakespeare solution. – John Dvorak – 2015-02-26T12:05:54.790
1@JanDvorak, I'm pretty sure that's impossible without using you,your,and,as, etc. more than 3 times. – bmarks – 2015-02-27T15:13:55.377
@bmarks do you need those in a Shakespeare program? I can't see a requirement for a readable prose. I can still see why the triple occurence maximum is really problematic. In fact, in order for a character to be useful it must 1) be declared, 2) enter a scene and either 3a) speak or 3b) be spoken to, then leave. A speaker can't leave and they can't speak twice. Since Shakespeare doesn't like more than two characters on a stage, you are essentially limited to one or two monologues at most. Have fun. – John Dvorak – 2015-02-27T15:29:53.353
@JanDvorak to assign variables you need to use you/thou. To do any kind of math operation (to limit the number of added characters) you need to use as. To do any comparison you need as or than. To do jumps/gotos (there are now other looping structures), there are a limited number of words you can use. Essentially, Shakespeare would have the same problems assembly would have with the triple occurrence limit. Also, the variables (characters) are not normally valid English words anyway. – bmarks – 2015-02-27T15:56:34.633
I'd like to drop the triple occurence limitation for Shakespeare, then. Even if it means I'm inegligible for winning. – John Dvorak – 2015-02-27T15:58:45.933
1@JanDvorak I'm fine with a Shakespeare submission that breaks that rule. Though to be fair it wouldn't be allowed to win. – Calvin's Hobbies – 2015-02-27T22:18:32.777
Can we instead opt to omit the space between two words, instead of replacing it with another character? – AJMansfield – 2015-02-28T14:56:43.420
This is an exceptionally difficult challenge. – AJMansfield – 2015-02-28T18:58:07.497
If you have enough rep and want to sort by activity, open in private browsing (or Incognito, or InPrivate, whatever) mode helps. (Can't vote, though.) – jimmy23013 – 2015-02-28T21:52:38.780
@user23013 or you could just click the "active" link to sort by activity? – user253751 – 2015-03-01T04:46:39.533
@immibis To hide so many deleted answers (which are already more than valid answers) after 2k rep. – jimmy23013 – 2015-03-01T04:58:54.243
@AJMansfield Sorry, no. It'd be unfair to make that a rule now since the challenge has been out for a while. – Calvin's Hobbies – 2015-03-02T05:53:04.903
Is the string literal "programming" in php code. (i.e) the word programming by itself as answer completely valid? Is that a loophole? – Rohan Jhunjhunwala – 2016-07-07T01:54:52.100
Oh missed that distinction my bad! – Rohan Jhunjhunwala – 2016-07-07T01:56:49.580
@JanDvorak my SPL answer definitely breaks the repetition rule. I doubt a quine is possible with the basic dictionary of allowed words in SPL, but if you manage to create one, I would love to see it. – Flogo – 2017-03-18T08:39:48.120
Can I treat a part that contain words as some replacement? – l4m2 – 2018-04-07T01:15:03.427
Are error quines okay? https://codegolf.stackexchange.com/a/96018/59376
– Magic Octopus Urn – 2019-01-31T18:43:54.687