this post was submitted on 10 Jan 2024
801 points (95.4% liked)

Programmer Humor

19512 readers
451 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] funkless_eck@sh.itjust.works 7 points 10 months ago (1 children)

On the other hand, which do you prefer, this:

 life ← {⊃1 ⍵ ∨.∧ 3 4 = +/ +⌿ ¯1 0 1 ∘.⊖ ¯1 0 1 ⌽¨ ⊂⍵}

or this:

 MODE UNIVERSE = [upb OF class universe, upb OF class universe]BOOL; STRUCT( INT upb, BOOL lifeless, alive, PROC(REF UNIVERSE)VOID init, PROC(REF UNIVERSE)STRING repr, PROC(REF UNIVERSE, INT, INT)VOID insert glider, PROC(REF UNIVERSE)VOID next ) class universe = ( # upb = # 50, # lifeless = # FALSE, # alive = # TRUE, # PROC init = # (REF UNIVERSE self)VOID: FOR row index FROM LWB self TO UPB self DO init row(self[row index, ]) OD, # PROC repr = # (REF UNIVERSE self)STRING:( FORMAT cell = $b("[]", " ")$, horizon = $"+"n(UPB self)("--")"+"l$; FILE outf; STRING out; associate(outf, out); putf(outf, (horizon, $"|"n(UPB self)(f(cell))"|"l$, self, horizon)); close(outf); out ), # PROC insert glider = # (REF UNIVERSE self, INT row, col)VOID:( self[row-2, col+1] := TRUE; self[row-1, col+2] := TRUE; self[row, col:col+2] := (TRUE, TRUE, TRUE ) ), # PROC next = # (REF UNIVERSE self)VOID:( [0:2, LWB self-1:UPB self+1]BOOL window;  # init row(window[LWB window, ]); window[LWB self, 2 LWB window] := window[LWB self, 2 UPB window] := window[UPB window, 2 LWB window] := window[UPB window, 2 UPB window] := lifeless OF class universe;  window[LWB self, LWB self:UPB self] := self[LWB self, ]; FOR row FROM LWB self TO UPB self DO REF []BOOL next row = window[(row+1) MOD 3, ]; IF row NE UPB self THEN next row[LWB self:UPB self] := self[row+1, ] ELSE init row(next row) FI; FOR col FROM LWB self TO UPB self DO INT live := 0;  FOR row FROM row-1 TO row+1 DO REF[]BOOL window row = window[row MOD 3, ]; FOR col FROM col-1 TO col+1 DO IF window row[col] THEN live +:= 1 FI OD OD; self[row, col] := IF window[row MOD 3, col] THEN live -:=  live = 3 FI OD OD ) );
[–] fl42v@lemmy.ml 4 points 10 months ago

Honesty, neither 🤣