Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- from simple_tools import *
- NUMBER: int = get_input_advanced(minimum=1)
- option: int = get_input_advanced('Record Hits [1], Misses [2], or Both [3]', 1, 3)
- padding: int = get_pad_length(NUMBER)
- # Explanation @ https://youtu.be/Da7vmPuokSE
- with output('w') as of :
- output_entries(of, NUMBER)
- spinner: Reporter = Reporter(NUMBER)
- for x in range(NUMBER) :
- spinner.add_step()
- sure_prime: bool = is_prime_primitive(x)
- posit_prime: bool = False
- # The hinted Test
- if x == 2 or x == 3 :
- posit_prime = True
- elif x % 2 and x % 3 :
- if (x - 25) % 30 :
- if (x - 35) % 30 :
- if (x - 35) % 42 :
- posit_prime = True
- #
- if option == 1 :
- if sure_prime == posit_prime :
- out_write_line(of, '({}) sure[{}] ^ posit[{}] = Hit;', pad_value_int(x, padding),
- str(sure_prime).ljust(5), str(posit_prime).ljust(5))
- elif option == 2 :
- if sure_prime ^ posit_prime :
- out_write_line(of, '({}) sure[{}] ^ posit[{}] = Miss;', pad_value_int(x, padding),
- str(sure_prime).ljust(5), str(posit_prime).ljust(5))
- else :
- out_write_line(of, '({}) sure[{}] ^ posit[{}] = {}.', pad_value_int(x, padding), str(sure_prime).ljust(5),
- str(posit_prime).ljust(5), ('Miss' if sure_prime ^ posit_prime else 'Hit '))
- spinner.stop()
- stop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement