Git Product home page Git Product logo

go-life's Introduction

go-life

Conway's Game of Life in Go, cross-platform
Uses Gio by @EliasNaur.

To build

For the desktop app, Go 1.12 is fine.

To build the web version (which you don't have to do if you only want to run it), you'll need 1.13 / go tip. (Explaining "go tip" is beyond the scope of this readme, sorry.)

Again: the www/ directory in the repo is ready to run, no need to (re)build it. So if you just want to try it, you don't need "go tip".

Desktop

% export GO111MODULE=on
% go run life.go

Browser:

Locally

% go get github.com/shurcooL/goexec
% goexec 'http.ListenAndServe(":8080", http.FileServer(http.Dir("www")))'

Browse to http://localhost:8080.

From Github

Browse to http://theclapp.github.io/go-life/www/.
May take a few moments to download on your first visit; ~4 mb download (~1 mb on the wire).

(May not work in Chrome (see #1) though it does for me. If not, try a different browser.)

Hotkeys

These work in the desktop app and in the browser.

  • q to quit (in the browser this just halts execution)
  • r to restart the universe with random cells
  • - (minus key) to reduce the scale (zoom out)
  • + to increase the scale (zoom in) (= also works)
  • < or , to slow down the generations
  • > or . to speed them up
  • p pause
  • c continue

You can also click-and-drag or scroll around.

You can't enter or save patterns yet.

Screenshots

macOS

Gio Life on macOS

Chrome

Gio Life on Chrome

go-life's People

Contributors

eliasnaur avatar theclapp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

eliasnaur

go-life's Issues

The Gio rewrite doesn't display anything in Chrome

[UPDATE: The issue's subject has changed, and it's no longer about the problem described right below. See the other comments for the actual topic (which is what the new Issue title indicates)!]

I just tried toying a bit with your nice & interesting experiment, but unfortunately I'm neither a Go nor a JS programmer, so can't quite tell immediately from the code: should the auto-update actually work?

It gets stuck like:

event is refresh({"delay":198.500000,"stop":0})
event recieved for req 0x119589a0, pageId 4; event is refresh({"delay":198.500000,"stop":0})
Updates finished for req 0x119589a0, pageId 4
starting Updates, pageId is 4, req is 0x11958a80
exit status 2

Manual page refresh works fine. (The last log line above is just a Ctrl-C after waiting a while.)

Thanks & all the best!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.