2024-02-28 21:39:47 +01:00
|
|
|
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])
|
|
|
|
|
2024-02-28 19:47:39 +01:00
|
|
|
def pixel(state, lives):
|
2024-02-28 21:39:47 +01:00
|
|
|
if lives in rules[1] and state == True:
|
|
|
|
# fals überleben soll
|
|
|
|
return True
|
|
|
|
## .....
|
|
|
|
if lives in rules[1] and state == True:
|
|
|
|
# uberlebe
|
|
|
|
return True
|
2024-02-28 19:47:39 +01:00
|
|
|
else:
|
2024-02-28 21:39:47 +01:00
|
|
|
return False
|
|
|
|
#return new
|
|
|
|
#if rules[0][lives] == False and rules[1][lives] == True: # soll überhaupt nix geschehen
|
|
|
|
# return state
|
|
|
|
#if rules[0][lives] == True: # wird geboren
|
|
|
|
# return True
|
|
|
|
#elif rules[1][lives] == True: # soll nix geschehen wen tot
|
|
|
|
# return state
|