Skip to content
Snippets Groups Projects
matrix.py 426 B
Newer Older
  • Learn to ignore specific revisions
  • Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    #!/usr/bin/python
    # -*- coding: utf-8 -*-
    """ matrix """
    
    from __future__ import print_function
    
    import itertools
    
    
    Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    CHARS = ['K', 'B', 'D']
    
    Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    MASK = ''.join(reversed(CHARS))
    for bits in itertools.product([0, 1], repeat=len(CHARS)):
        SBIT = "".join(str(bit) for bit in bits)
        NST = ""
        for i, _ in enumerate(SBIT):
            if SBIT[i] == "1":
                NST += MASK[i]
            else:
                NST += "-"
        print(NST)