Advertisement
Guest User

Slot quiz bruteforce script

a guest
Mar 25th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.76 KB | None | 0 0
  1. count = 0
  2. all_ans = []
  3. for a in range(30):
  4.     for b in range(30):
  5.         for c in range(30):
  6.             for d in range(30):
  7.                 test1 = a + b + a
  8.                 test2 = a + c + c
  9.                 test3 = c + d + d
  10.                 if (test1 == 30 and test2 == 16 and test3 == 21):
  11.                     count += 1
  12.                     ans = a + c + d
  13.                     all_ans.append(ans)
  14.                     print("-------- [RESULT {}] --------".format(count))
  15.                     print("TEST 1: a({0})\t+\tb({1})\t+\ta({0})\t=\t{2}".format(a, b, test1))
  16.                     print("TEST 2: a({0})\t+\tc({1})\t+\tc({1})\t=\t{2}".format(a, c, test2))
  17.                     print("TEST 3: c({0})\t+\td({1})\t+\td({1})\t=\t{2}".format(c, d, test3))
  18.                     print("ANSWER: a({})\t+\tc({})\t+\td({})\t=\t{}".format(a, c, d, ans))
  19. print("-------- [ANSWER] --------")
  20. print("POSSIBLE ANSWER: {}".format(repr(list(set(all_ans)))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement