Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cgol: binary, expansive engine #4

Open
rabsef-bicrym opened this issue Dec 16, 2022 · 0 comments
Open

cgol: binary, expansive engine #4

rabsef-bicrym opened this issue Dec 16, 2022 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@rabsef-bicrym
Copy link
Member

rabsef-bicrym commented Dec 16, 2022

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

@rabsef-bicrym rabsef-bicrym converted this from a draft issue Dec 16, 2022
@rabsef-bicrym rabsef-bicrym added the help wanted Extra attention is needed label Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
Development

No branches or pull requests

1 participant