示例#1
0
def ManNumSeq(oldFilePath):
    txtparser = Parser(oldFilePath)
示例#2
0
'''
Created on Jul 2, 2015

@author: Nicoli
'''
from cellularautomata.modules.CellularAutomata import TotalisticCode
from cellularautomata.modules.ParserImgText import ImgtoText, Parser

from cellularautomata.modules.CAOutput import AutomataImage

if __name__ == '__main__':
    tc = TotalisticCode(330, 3, 2)
    tci = AutomataImage(10, tc, '', '.png')
    print(tci.dictColor)
    a = ImgtoText(3, '330.png', '')
    print(a.dictTxt)
    aParser = Parser('fromimg/Totalistic/330.txt', '')
    aParser.removeSeparator('\n')

    aParser.setBitsSeparation('\n', 7)
    print(aParser.strData)
    aParser.binary()
    print(aParser.strData)
    aParser.setNewFile()
示例#3
0
from cellularautomata.modules.CAOutput import AutomataImage, AutomataText

if __name__ == '__main__':

    #     elementar = [72, 136, 103, 91, 30, 73, 101, 105, 129, 137, 161, 183, 169, 214, 225, 45, 26, 57, 62, 89]
    #
    #     for i in elementar:
    #
    #         rule = RuleNumber(i)
    #         ruletext = AutomataText(1000, 1000, rule, 1)
    #         ruletext.setFile()
    #         ParserSieve(str(ruletext.autocel.rule))

    #===============================================================================
    #     ec = ElementaryCode(45)
    #     ectext = AutomataText(20, 10, ec, '');

    #===========================================================================
    a = [
        1022, 1006, 1092, 1140, 1113, 1055, 600, 843, 870, 1085, 1167, 1329,
        1572, 1815, 1942, 1599, 993, 777, 1041, 1038, 2022, 1020, 1074, 1041,
        177, 912, 1636, 2049, 2048, 583, 578
    ]
    for i in a:
        tc = TotalisticCode(i, 3, 1)
        tctext = AutomataText(100, 10000, tc, '')
        parsertctext = Parser('/original/Totalistic/' + str(i) + '.txt')
        parsertctext.removeSeparator('\n')
        parsertctext.setNewFile('')