Commits

ronald martinez  committed 207d129

ok

  • Participants
  • Parent commits 767b3a7

Comments (0)

Files changed (1)

     input = input.read().split('\n')[:-1]
 
     n = 8
-
-    def output2(op):
-        new_phase = ''
-
-        for x in op:
-            if x == ' ':
-                new_phase += ' '
-            elif x == '+':
-                new_phase += x
-            else:
-                new_phase += '*'
-
-        return new_phase
+    chr = '*'
 
     phase = ''
     phase1 = input[random.randint(0, len(input) - 1)]
-    phase1 = 'macdo nald'
-    phase_original = 'macdo nald'
+    phase_original = phase1
+
+    #print 'phase_original: %s' % phase_original
 
     while 0 < n:
 
+        n -= 1
+
         if phase in phase1:
-            phase1 = phase1.replace(phase, '*' * len(phase))
+            phase1 = phase1.replace(phase, chr * len(phase))
 
         output = ''
         for y, x in enumerate(phase1):
 
-            if x == '*':
+            if x == chr:
                 output += phase_original[y]
             elif x == ' ':
                 output += ' '
             else:
-                output += '*'
+                output += chr
 
         if output == phase_original:
+            print 'excelent'
             break
-
-        n -= 1
+        else:
+            if n == 0:
+                print 'so bad'
+                break
 
         print 'phase: %s' % output
         phase = raw_input('Enter phase: ')