--- /dev/null
+import random
+
+things_to_try = [
+
+ # For starters
+ "reading the title and the blurb",
+ "typing it into a search engine",
+ ("pursuing even a train of thought that doesn’t seem " +
+ "to give a cogent answer at first"),
+ "looking at the list of helpful websites",
+ "looking at the binder of useful stuff",
+
+ # Letters and words
+ "alphabetizing",
+ "using the leftover letters to spell something",
+ "rearranging the letters (aka “anagramming” or “transposing”)",
+ "looking for unusual letter frequencies",
+ "determining if it is a Rot 13/Caesar shift in general",
+ "shifting from letters to numbers",
+ "treating letters as protein sequences",
+ "treating letters as call letters",
+ "turning it into a cryptic crossword clue",
+ "seeing if these words relate to song lyrics",
+ "seeing if there are any acronyms of phrases",
+ ("diagonalizing (taking the first letter of the first answer, " +
+ "the second letter of the second. . .)"),
+ "looking at a computer keyboard",
+ "a pun",
+
+ # Numbers
+ "graphing it functionally",
+ "graphing it parametrically",
+ "checking to see if your numbers are in the right base (including hex)",
+ "shifting from numbers to letters",
+ "using it as a phone number",
+ "using it as an IP address",
+ "matching numbers to MIT buildings",
+ "matching numbers to MIT courses",
+ "treating numbers as dates",
+ "treating numbers as atomic weights, numbers, etc.",
+ "treating numbers as latitude/longitude or GPS coordinates",
+ "treating numbers as radio stations",
+ "treating numbers as ASCII numbers",
+ "treating numbers as PLU numbers",
+ "treating numbers as ISBN numbers",
+ "seeing if there are any strange sequences",
+ "seeing if prime numbers are involved",
+ "seeing if fundamental constants are involved",
+ "asking what other numbers are close to the one you have",
+
+ # Thirteen ways of looking at a puzzle
+ "looking at it in a mirror",
+ "squinting at it from far away",
+ "tilting it",
+ "looking at it upside down",
+ "looking through it",
+ "rewriting it neatly",
+ "rewriting it on graph paper",
+ "saying it out loud to someone else",
+ "putting yourself in the constructor’s shoes",
+ "making it 3D",
+ "cutting it up",
+ "folding it",
+ "connecting the dots",
+
+ # What is it",
+ "looking at a song/poem/book/movie/TV show",
+ "Braille",
+ "Morse code",
+ "overlaying it on a map of MIT",
+ "getting on the T",
+ "checking it for pop culture references with Tanis, Jenn, Denis or James",
+ "using the Library of Congress or Dewey decimal system",
+ ("asking whether it has anything to do personally with the " +
+ "constructing team"),
+ "Palm graffiti",
+ "running it by someone who goes to MIT",
+
+ # Zen
+ "trusting your instincts",
+ "trusting someone else’s instincts",
+ "asking “what’s weird about this?”",
+ "taking a step back",
+ "asking for fresh brains",
+ "checking your work",
+ "asking someone else to check your work",
+ "explaining your work to someone else",
+ "doing what you’ve already done again to the output",
+ "consulting the list of expertise",
+ "leaving the room",
+ "asking people if it looks like anything they recognize",
+ "thinking about what’s missing",
+ "asking yourself whether you’ve used all the information",
+ "keeping even a strange-looking result",
+ "brute force",
+ "not thinking about it",
+ "splitting up tasks to solve in a group",
+ "talking to a hunt veteran",
+ "talking to a hunt newbie",
+ "asking “what’s the pattern”",
+ "rereading the instructions",
+]
+
+def have_you_tried():
+ return "Have you tried {}?".format(random.choice(things_to_try))
)
from turbot.round import round_quoted_puzzles_titles_answers
from turbot.help import turbot_help
+from turbot.have_you_tried import have_you_tried
import turbot.rot
import turbot.sheets
import turbot.slack
Displays help on how to use Turbot.
"""
+ channel_name = body['channel_name'][0]
channel_id = body['channel_id'][0]
response_url = body['response_url'][0]
+ # Process "/help me" first. It calls out to have_you_tried rather
+ # than going through our help system.
+ #
+ # Also, it reports in the current channel, (where all other help
+ # output is reported privately to the invoking user).
+ if args == "me":
+ to_try = have_you_tried()
+
+ # If this is a direct message then there's not a usable channel_id
+ # and we have to use the response_url instead
+ if channel_name == "directmessage":
+ requests.post(response_url,
+ json = {"text": to_try},
+ headers = {"Content-type": "application/json"})
+ else:
+ turb.slack_client.chat_postMessage(
+ channel=channel_id, text=to_try)
+ return lambda_ok
+
help_string = turbot_help(args)
- # The "/help me" command is special in that it reports in the
- # current channel, (where all other commands report privately to
- # the invoking user).
- if args == "me":
- turb.slack_client.chat_postMessage(
- channel=channel_id, text=help_string)
- else:
- requests.post(response_url,
- json = {"text": help_string},
- headers = {"Content-type": "application/json"})
+ requests.post(response_url,
+ json = {"text": help_string},
+ headers = {"Content-type": "application/json"})
return lambda_ok