20
\$\begingroup\$

Stack Exchange currently has 134 question and answer sites. This includes all beta sites (such as PPCG) but not Area 51 proposals nor any meta sites, except for the "mother meta".

To answer this question, choose one of those sites and write a program where every line of code is an anagram of the title of a different question on that site. Any questions from that site may be used as long as they have not been deleted, and were asked before this question.

The title of a question includes all characters that appear in the Title textbox when the edit link is clicked below a question, be they whitespace, mathjax formatting, crazy Unicode characters, whatever. (You can use the Stack Exchange API if you want to query a bunch of question titles at a time.)

The program you write must output the string that reliably appears at the top of every Stack Exchange page:

Questions Tags Users Badges Unanswered Ask Question

This exact text, plus an optional trailing newline, is the only thing your program should output. There is no input. The output should go to stdout or, if that's not possible, a similar alternative.

Since doing this with only anagrams of question titles may be kind of tricky, you may optionally add one character of your choice to each line in your program, in any column. Not all lines need to have an extra character and it does not have to be the same character across lines. The character may be anything except for a line terminator. The characters in the line minus this one new character should still be a perfect anagram of a question title.

Scoring

Your score is (number of lines with no added character) + 2 * (number of lines with an added character). The lowest score wins. In case of ties the earlier answer wins.

Details

  • You must provide links to all the questions you have used the titles from.

  • You may choose the same Stack Exchange site as someone else though you are encouraged to choose unused sites, just for some variety.

  • If a question you used gets deleted before the winner is chosen, your submission will be invalid, so it's best to choose well established questions.

  • If titles are edited on some of your questions then your submission is still valid as long as the edit history shows that your titles were correct when you posted your answer.

  • Comments in your program are fine.

  • Editing question titles to suit your needs is very bad form.

\$\endgroup\$
  • 1
    \$\begingroup\$ Quotes are hard to find ... \$\endgroup\$ – Optimizer Feb 4 '15 at 10:40
  • 5
    \$\begingroup\$ Let's do this. \$\endgroup\$ – Sp3000 Feb 4 '15 at 10:41
9
\$\begingroup\$

Python 2, score = 2

print '''               &''(()),..===>>?''HHIMMMMPPaaaaabccdddeeeeeeeeeegggimmmmnnnnnoooooprrrrsstwyy''' and 'questions tags users \
badges unanswered ask question'.title() or '             $.?IIWaaabbccccccceeefghhhhhhiijjkklllllmmnnnoooprrrstttttttuxyyz'

I couldn't quite get it in one line, so here's a fairly straightforward solution in two.

I found the questions on Stack Overflow by regexing through the 50,000 longest titles:

Here's my best attempt at a one-liner for anyone who's going for it (feel free to use it):

print "questions tags users badges unanswered ask question".title() or AHHRUaacccceeeeeeeeeffghikkllmnnnooooooorrrrrrrtwwwy

How to guarantee uniqueness of a referrer who clicks on a link in a remote webpage("Request.UserHostAddress" not working correctly)?

\$\endgroup\$
10
\$\begingroup\$

Golfscript, 3 lines with no added characters

"Questions Tags Users Badge"'exception SLSATE[HY000][1049]eymfny incnue while pn chma afte intallin FOSBundl'or
"s Unanswered Ask "'Reoccurring error The current idetity(NT THORITY\NETWORK SERVICE)oe ot have it cc toC:\WINDOWS\Microsoft.NET\Framewor\v2.0.50727\Tempary ASP.NET Files'or
"Question""D he 'S'  SL stand f standard or strctured?"or

I hit StackOverflow, since it probably had the most (useful) posts. A lot of Qs could be found in jQuery and SQL.

Bibliography:

Uses two strings each line, and takes the first one with or. I don't know any proper Golfscript, but I tested it here.

It's possible to get the necessary quotes in two lines, but you'll need a language that lets you dump chars.

\$\endgroup\$
3
\$\begingroup\$

Pyth, 2, 1 line with 1 extra character.

r"questions tags users badges unanswered ask question"tyhgkk)            (.?AHHRUaacccceeeeeeeeeeffiiilllmnnnnooooooooprrrrrrrrtttwww

Uses grc's How to guarantee uniqueness of a referrer who clicks on a link in a remote webpage("Request.UserHostAddress" not working correctly)?, which unfortunately requires an extra s to work.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.