mache morgen weiter
This commit is contained in:
parent
79a048dfd6
commit
728f655e11
1 changed files with 30 additions and 10 deletions
40
rules.py
40
rules.py
|
@ -1,12 +1,32 @@
|
||||||
|
rules =[
|
||||||
|
# 0 1 2 3 4 5 6 7 8
|
||||||
|
#[False,False,False,True ,False,False,False,False,False], #geburt
|
||||||
|
#[True ,True ,False,False,True ,True ,True ,True ,True ] #tot
|
||||||
|
# 23/3
|
||||||
|
# bei 2 und 3 überleb
|
||||||
|
# bei 3 geburt
|
||||||
|
[False,False,False,True ,False,False,False,False,False], #geburt
|
||||||
|
[False,True ,True ,True ,True ,True ,False,False,False]
|
||||||
|
#tot
|
||||||
|
#12345/3
|
||||||
|
]
|
||||||
|
#rules = ([1,2,3,4,5],[3])
|
||||||
|
rules = ([2,3],[3])
|
||||||
|
|
||||||
def pixel(state, lives):
|
def pixel(state, lives):
|
||||||
if state:
|
if lives in rules[1] and state == True:
|
||||||
if lives <= 1 or lives >= 4:
|
# fals überleben soll
|
||||||
new = False
|
return True
|
||||||
|
## .....
|
||||||
|
if lives in rules[1] and state == True:
|
||||||
|
# uberlebe
|
||||||
|
return True
|
||||||
else:
|
else:
|
||||||
new = True
|
return False
|
||||||
else:
|
#return new
|
||||||
if lives == 3:
|
#if rules[0][lives] == False and rules[1][lives] == True: # soll überhaupt nix geschehen
|
||||||
new = True
|
# return state
|
||||||
else:
|
#if rules[0][lives] == True: # wird geboren
|
||||||
new = False
|
# return True
|
||||||
return new
|
#elif rules[1][lives] == True: # soll nix geschehen wen tot
|
||||||
|
# return state
|
Loading…
Reference in a new issue