def clarify(self, request):
     pretty_print("Find an arithmetic expression using the operators +, *, -, parentheses,"\
           " and the numbers {} each exactly once, whose value is {}".format( 
               ", ".join(str(x) for x in self.atoms), self.val
          ))
     print("")
     pretty_print("Note that you can't use - to make a negative number directly, e.g. -3*4,"\
          " and you can't use / or ^.")
 def clarify(self, request):
     pretty_print('There is a simple rule that relates each string '\
           'on the left hand side to its partner on the right hand side.'\
           ' Find the rule, and determine what string should replace "?".'\
           'The rule consists of up to {} atomic operations, '\
           'each of which is one of:'.format(self.op.size()))
     print(' (*) Switching two positions in the string')
     print(' (*) Reversing the string')
     print(' (*) Rotating the whole string a random distance to the left or right')
     print('     (e.g. shifting each symbol one step to the right, and replacing the first with the last)')
     print(' (*) Applying the substitution {} (or its reverse) at one index'.format(
         '->'.join(self.alphabet + self.alphabet[0])
     ))
     print(' (*) Replacing each {0} with {1} and vice versa (or {1} with {2}, etc.)'.format(
         self.alphabet[0], self.alphabet[1], self.alphabet[2]
     ))
    def onpick1(event):
        if isinstance(event.artist, Line2D):
            thisline = event.artist
            xdata = thisline.get_xdata()
            ydata = thisline.get_ydata()

            ind = event.ind

            points_info = ""
            for i in ind:
                xd = xdata[i]
                yd = ydata[i]

                for cs in cdist:
                    if cs.repetitions[cs.rank] == xd and cs.instants_distances_mean == yd:
                        points_info += str(cs)+"\n"
            print(pretty_print(points_info, "Points info"))
def display_intro():
    paragraphs = []
    paragraph = ""
    last_line = None
    try:
        with open('intro', 'r') as f:
            for line in f:
                if line == '\n' and last_line == '\n':
                    pretty_print(paragraph)
                    raw_input()
                    paragraph = ""
                else:
                    paragraph = paragraph + line
                last_line = line
            pretty_print(paragraph)
            raw_input("")
    except IOError:
        pretty_print("You should have gotten an intro just then, but something went wrong!"\
        " Sorry about that. Anyway, it's not that hard; you'll catch on.\n")
 def clarify(self, request):
     pretty_print("Enter the number to the left of a setting to toggle the indicated setting"\
     " or perform the indicated operation.")
 def clarify(self, request):
     pretty_print("Enter the number to the left of a question type "\
           "to answer questions of that type.")
     for option in self.options:
         if 'clarification' in option and option['clarification']:
             pretty_print(option['clarification'])
 def clarify(self, request):
     pretty_print('Rearrange the letters "{}" to make '\
           'an English word or proper noun.'.format(self.scrambled))