dalten-collective / cgol Goto Github PK
View Code? Open in Web Editor NEWThis project forked from tiller-tolbus/cgol
License: The Unlicense
This project forked from tiller-tolbus/cgol
License: The Unlicense
n
second timer between phasesplay
with a value of on
causes us to continue playingsave
and save the state of my game to state
make
to make a new boardload
and I'm taken to /game/hoon
Current RLE
-> @ub
conversion routine:
:: +brun: binary from run
::
++ brun
^- $-([rows @ud] bin)
|= [ran=rows x=@ud]
=| bun=@ub
|-
?~ ran bun
?@ i.ran
:: on newline, pad the row
=? bun
!=(0 (mod (met 0 bun) x))
(rsh 0^(mod (met 0 bun) x) bun)
$(ran t.ran)
%= $
ran t.ran
::
bun
(cat 0 (fil 0 +.i.ran ?-(-.i.ran %live 0b1, %dead 0b0)) bun)
==
Write an engine that can take, e.g., the classic blinker 3o
(0b111
) and compute its movement on a stage that is programmatically large enough to encompass any movement (i.e., in this case, 5x5
grid to show all movement and all possible, relevant neighbors to live cells) using only hoon's bit arithmetic and logic functions.
The ultimate goal here is to write a flexible, binary engine for cgol
that expands to form a square board to encompass all possible live cells produced by some initial seed formation.
See run length encoding, this
++ ngen
|%
+$ stat [ole=board nel=(list ?) [x=@ud y=@ud]]
++ play
^- $-([game @ud] game)
|= [gam=game n=@ud]
|^ ^- game
|- ?: =(0 n) [%0 size.gam step.gam bord.gam]
$(bord.gam (next bord.gam), n (dec n), step.gam +(step.gam))
++ next
|= bord=board
=; [neu=board sta=stat]
neu
%^ spin
bord
[ole=bord nel=*(list ?) [x=*@ud y=*@ud]]
|= [cur=(list ?) stat]
|-
?~ cur [`(list ?)`(flop nel) [ole ~ [0 +(y)]]]
=+ fren=(friends x y ole)
?: ?=(%.y i.cur)
?: (lth fren 2) $(cur t.cur, x +(x), nel [%| nel]) :: overexposed
?: (gth fren 3) $(cur t.cur, x +(x), nel [%| nel]) :: overcrowded
$(cur t.cur, x +(x), nel [%& nel]) :: goldilocks!
?: =(3 fren) $(cur t.cur, x +(x), nel [%& nel]) :: necromancy!
$(cur t.cur, x +(x), nel [%| nel])
++ friends
|= [x=@ud y=@ud ole=board]
=+ max-y=(dec y.size.gam)
=+ max-x=(dec x.size.gam)
;: add
?:(|(=(0 x) =(0 y)) 0 !(snag (dec x) (snag (dec y) ole))) :: up-left
?:(=(0 y) 0 !(snag x (snag (dec y) ole))) :: up
?:(|(=(0 y) =(max-x x)) 0 !(snag +(x) (snag (dec y) ole))) :: up-right
?:(=(0 x) 0 !(snag (dec x) (snag y ole))) :: left
:: 0 :: me
?:(=(max-x x) 0 !(snag +(x) (snag y ole))) :: right
?:(|(=(0 x) =(max-y y)) 0 !(snag (dec x) (snag +(y) ole))) :: down-left
?:(=(max-y y) 0 !(snag x (snag +(y) ole))) :: down
?:(|(=(max-y y) =(max-x x)) 0 !(snag +(x) (snag +(y) ole))) :: down-bad
==
--
--
IDK make it look good.
[%make x=@ud y=@ud]
[%load =id]
[%play =id steps=@ud]
[%drop =id]
User Stories:
RLE
encoded run
.load
next to a game and be sent to ../play/hoon
with that game loaded/play/hoon
api: URL parameter game
= @uv
of game you wish to load.
cgol
stores active game sessions as a game
, below:
+$ game
$: %0
size=[x=@ud y=@ud]
step=@ud
bord=board
==
Where a board
is a (list (list ?))
. This format affords us easy conversion to a bitmap
image for mini-map views for selecting saved games.
Please write an arm in /lib/cgol/play/hoon
$-((list (list ?)) bmp)
where bmp
is encoded such that it can be directly inserted into a sail page img
tag as src
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.