Skip to content

Commit

Permalink
Add LWSS and MWSS (#55)
Browse files Browse the repository at this point in the history
Signed-off-by: Lili Fehertoi <lfehertoi@gmail.com>
Co-authored-by: Lili Fehertoi <lfehertoi@gmail.com>
  • Loading branch information
ljvmiranda921 and lfehertoi99 committed Sep 8, 2020
1 parent 4e00f66 commit ea98127
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
6 changes: 5 additions & 1 deletion seagull/lifeforms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@
Beacon,
Pentadecathlon,
)
from .gliders import Glider
from .gliders import (
Glider,
LightweightSpaceship,
MiddleweightSpaceship,
)
from .growers import Unbounded
from .random import RandomBox
from .custom import Custom
Expand Down
33 changes: 33 additions & 0 deletions seagull/lifeforms/gliders.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,36 @@ def __init__(self):
@property
def layout(self) -> np.ndarray:
return np.array([[1, 0, 0], [0, 1, 1], [1, 1, 0]])


class LightweightSpaceship(Lifeform):
def __init__(self):
super(LightweightSpaceship, self).__init__()

@property
def layout(self) -> np.ndarray:
return np.array(
[
[0, 1, 0, 0, 1],
[1, 0, 0, 0, 0],
[1, 0, 0, 0, 1],
[1, 1, 1, 1, 0],
]
)


class MiddleweightSpaceship(Lifeform):
def __init__(self):
super(MiddleweightSpaceship, self).__init__()

@property
def layout(self) -> np.ndarray:
return np.array(
[
[0, 0, 0, 1, 0, 0],
[0, 1, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0],
[1, 0, 0, 0, 0, 1],
[1, 1, 1, 1, 1, 0],
]
)

0 comments on commit ea98127

Please sign in to comment.