Giter VIP home page Giter VIP logo

agentgopher's People

Contributors

emgrasmeder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

auletes

agentgopher's Issues

Make a grid of squares

When I look at the webpage I want to see a grid:

  • big containing div with black border
  • contains smaller squares each with a border
  • when squares are filled in, there is no whitespace

Backend to have an account of what exists in the front end

The backend should have a slice of slices representing the liveliness of each cell, and this should be updated each time a user clicks on a cell.

Perhaps as another story, this will also be updated according to how the game plays itself out.

Conways Game of Life

In a file called conway/conway.go,
implement conway's game of life.
Most agent functions should go in agent.go or manager.go files

Trigger toggle event from external input

Because I want the cells to change colors in a separate backed service, agents should be able to be spawned from stdin or from a websocket or something else. We can close this issue when a JSON object will be able to change the status of an agent. The implementation of exactly how still needs to be decided.

Options:

Ticker Counter

Make a "next" button that increments a "steps" counter located at the bottom of the page

CheckOrigin to be somewhat restrictive

Right now we're implementing Gorilla/Websocket's example of allowing connections from any origin, like:

var upgrader = websocket.Upgrader{
    CheckOrigin: func(r *http.Request) bool { return true },
}

and maybe someday we want this to be a little less relaxed.

test front end

test that:

  • there exists 9 squares
  • initially no squares are hidden
  • squares hide on click
  • is on travis

Make an even simpler front end

For whatever reason I'm completely set on using just Golang, HTML, and CSS to do this visualization.

The baby step that I want is to kick off a timer with a button, and hide a box when the timer (10 seconds) is done.

  • Start button
  • Start button kicks off timer
  • Timer value changes on display
  • Box disappears at the end of time

Make a moving agent, dispatched from the backend

To prove that the backend actually connects to the front end, I want to implement some basic "agent", to move beyond the concept of just a cell.

This might also introduce the concept of "periods" or "time activations", but it probably won't need to be too robust.

The idea is that at time t=0, cell 0 is "activated", meaning it turns a certain color (anything but white).
At time t=1, cell 0 goes white, and cell 1 "activates" to a non-white color, and this continues until we all the cells have been activated and deactivated in sequence. The color and timing will be sent in messages by the backend, and the whole sequence will be kicked off by a single button click.

Cells have names

In order to change cells from server messages, each cell needs a name or something.

Backend message management

The backend needs to receive, parse, and respond to messages. It also needs to package events and deliver them to the front end.

I think there should be a Message Manager in the backend which:

  1. Takes a map type and returns a byte array, which could be used here
  2. Parses the message received from the frontend (potentially as a map) and incorporates the update as appropriate
  • Let's start with a "Clear All" button (#23, #20)
    • The front end needs to send updates to the backend
    • The back end needs to keep track of what has happened on the front end
    • The clear all button will update both the front end and the back end and set each cell to its default state

use redux

The app should be able to turn cells visible and invisible via the redux store. As another story, it should also send messages back to the server via the redux store.

Move cell by button press

I'd like there to be an "edit" mode and a "select" mode. In "select" mode, clicking on the square only highlights the square.

If the square is highlighted and a living cell, you should be able to move it with the arrow buttons.

Drag field border to increase size dynamically

When a user clicks on the border of the field, they should be able to drag it to change the size.

  • if the number of cells is fixed, the size of each cell should change
  • if the number of cells has not explicitly been defined, cells should increase in number and stay the same size

Change grid to be NxN cells that is rendered algorithmically

In order to scale the application, all the cells should be created dynamically; whereas they are currently created explicitly in 9 consecutive div tags.

  • Even if the number is fixed per page-render, change the number of cells in the code by an order of magnitude should be trivial.

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.