Remake of this example using NetworkVizJS.
This example shows how easy it is to create a graph that changes dynamically.
| package main | |
| import ( | |
| "fmt" | |
| "net/http" | |
| "reflect" | |
| "runtime" | |
| ) | |
| func hello(w http.ResponseWriter, r *http.Request) { |
| <svg id="screen"> | |
| <line x1="0" y1="400" x2="500" y2="400" stroke="green" stroke-width="4" /> | |
| <rect id="player" width="50" height="50" /> | |
| </svg> |
| var screen = document.getElementById("screen"); | |
| var player = document.getElementById("player"); | |
| var height = 400, | |
| width = 500, | |
| playerHeight = 50, | |
| playerWidth = 50; | |
| // Add width and height to the screen. | |
| screen.style.width = width; |
Remake of this example using NetworkVizJS.
This example shows how easy it is to create a graph that changes dynamically.
Modified version of this demonstration showing how to dynamically modify groups.
| #... Previous module up here ... | |
| defmodule Solution do | |
| #... Your code will live here | |
| end |
| [package] | |
| name = "snake_game" | |
| version = "0.1.0" | |
| authors = ["youcodethings <spyr1014@gmail.com>"] | |
| [dependencies] | |
| piston = "0.36.0" | |
| piston2d-graphics = "0.26.0" | |
| pistoncore-glutin_window = "0.45.0" | |
| piston2d-opengl_graphics = "0.52.0" |
| // JS calling Rust | |
| var addon = require('../native'); | |
| console.log(addon.hello()); | |
| // -> "hello node" | |
| console.log(addon.adder(1,2)); | |
| // -> 3 | |
| console.log(addon.objAdder({a: 2, b: 5})); |
| [package] | |
| name = "quiz" | |
| version = "0.1.0" | |
| authors = ["andrew <spyr1014@gmail.com>"] | |
| [dependencies] |
| [package] | |
| name = "specs-roguelike" | |
| version = "0.1.0" | |
| authors = ["youCodeThings"] | |
| edition = "2018" | |
| [dependencies] | |
| tcod = "0.13" | |
| specs = "0.14.0" |