32 lines
812 B
Python
32 lines
812 B
Python
|
|
# Modulo Test
|
||
|
|
from prbraid.math import *
|
||
|
|
from prbraid.color import *
|
||
|
|
|
||
|
|
def main():
|
||
|
|
while True:
|
||
|
|
x = None
|
||
|
|
try:
|
||
|
|
uprint('This is red!', color=Color.Red, end=' ', flush=False)
|
||
|
|
uprint('And this is green!', color=Color.Green, flush=True)
|
||
|
|
x = int(input('[n]: '))
|
||
|
|
except ValueError:
|
||
|
|
continue
|
||
|
|
|
||
|
|
# calculate left padding to align i values
|
||
|
|
lpadded = len(str(x))
|
||
|
|
|
||
|
|
# find all invertible elements (skipped for now)
|
||
|
|
for i in range(x):
|
||
|
|
lpad = ' ' * (lpadded - len(str(i)))
|
||
|
|
grp = orbit(i, x)
|
||
|
|
print(f'{lpad}{i} -> {len(grp)} | {grp}')
|
||
|
|
print() # empty new line
|
||
|
|
|
||
|
|
if __name__ == '__main__':
|
||
|
|
try:
|
||
|
|
main()
|
||
|
|
except (KeyboardInterrupt, EOFError):
|
||
|
|
pass
|
||
|
|
|
||
|
|
|