Skip to content
Snippets Groups Projects
Select Git revision
  • 2570a5ca010fe693708a6b63eb747471d410446c
  • master default protected
  • lifecycle
  • kru0052-master-patch-91081
  • chat
  • 20180621-revision
  • 20180621-before_revision
7 results

matrix.py

Blame
  • matrix.py 426 B
    #!/usr/bin/python
    # -*- coding: utf-8 -*-
    """ matrix """
    
    from __future__ import print_function
    
    import itertools
    
    CHARS = ['K', 'B', 'D']
    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)