cca
diff state.py @ 89:08b9cff3aa10
Names of modules automata and state changed for PEP-8
author | darkhan |
---|---|
date | Mon, 13 Dec 2010 22:32:10 +0300 |
parents | State.py@7502b6193014 |
children | 7eeedb501691 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/state.py Mon Dec 13 22:32:10 2010 +0300 1.3 @@ -0,0 +1,16 @@ 1.4 +class State(object): 1.5 + 1.6 + def __init__(self, name, symbol, color, key, nums): 1.7 + #nums - next step ondition, list with numbers from 0 to 9 1.8 + self.name = name 1.9 + self.symbol = symbol 1.10 + self.color = color 1.11 + self.key = key 1.12 + self.nums = nums 1.13 + 1.14 + def next_state(self, num): 1.15 + #num - number of cells with the same state 1.16 + return num in self.nums 1.17 + 1.18 + def __repr__(self): 1.19 + return self.symbol + " " + self.name