ljsalkjfsalkj

This commit is contained in:
Peder Bergebakken Sundt 2024-02-13 20:21:09 +01:00
commit 59fec1f1e6
3 changed files with 23 additions and 0 deletions

1
.envrc Normal file
View File

@ -0,0 +1 @@
use nix

11
main.py Normal file
View File

@ -0,0 +1,11 @@
import numpy as n,pygame as p
q=(999,)*2
b=n.random.rand(*q)>.3
t=p.display
r=n.roll
o=p.surfarray.pixels2d(t.set_mode(q))
while 1:
w=sum(r(r(b,a,0),c,1)for a in[-1,0,1]for c in[-1,0,1])
b=b&((w==3)|(w==4))|((~b)*(w==3))
o[:,:]=0-b
t.flip()

11
shell.nix Normal file
View File

@ -0,0 +1,11 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
packages = with pkgs; [
(python3.withPackages ( ps: with ps; [
numpy
pygame
ptpython
]))
];
}