Permalink
Browse files

Fix grid building function

  • Loading branch information...
vorce committed Sep 18, 2018
1 parent db8db8d commit 4b688b73f6332c4563eafe9e9bbf655b0d155e5f
Showing with 5 additions and 5 deletions.
  1. +4 −4 lib/scenes/game_of_life.ex
  2. +1 −1 mix.lock
@@ -47,16 +47,16 @@ defmodule Golux.Scene.GameOfLife do
def build_grid(graph, {width, height}, spacing) do
horizontal =
Enum.reduce(0..width, graph, fn x, acc ->
Enum.reduce(0..height, graph, fn y, acc ->
acc
|> Scenic.Primitives.line({{0, spacing * x}, {width, spacing * x}},
|> Scenic.Primitives.line({{0, spacing * y}, {width, spacing * y}},
stroke: {1, :white}
)
end)
Enum.reduce(0..height, horizontal, fn y, acc ->
Enum.reduce(0..width, horizontal, fn x, acc ->
acc
|> Scenic.Primitives.line({{spacing * y, 0}, {spacing * y, height}},
|> Scenic.Primitives.line({{spacing * x, 0}, {spacing * x, height}},
stroke: {1, :white}
)
end)
@@ -3,7 +3,7 @@
"combine": {:hex, :combine, "0.10.0", "eff8224eeb56498a2af13011d142c5e7997a80c8f5b97c499f84c841032e429f", [:mix], [], "hexpm"},
"elixir_make": {:hex, :elixir_make, "0.4.2", "332c649d08c18bc1ecc73b1befc68c647136de4f340b548844efc796405743bf", [:mix], [], "hexpm"},
"gettext": {:hex, :gettext, "0.16.0", "4a7e90408cef5f1bf57c5a39e2db8c372a906031cc9b1466e963101cb927dafc", [:mix], [], "hexpm"},
"golex": {:git, "https://github.com/vorce/golex.git", "3e58ca1a5f46a7f6a10abd1d391bc0a643572c9b", [branch: "optimize_world_tick"]},
"golex": {:git, "https://github.com/vorce/golex.git", "ec22c77e8801abd77966a01585008b333d3b4164", [branch: "master"]},
"hackney": {:hex, :hackney, "1.14.0", "66e29e78feba52176c3a4213d42b29bdc4baff93a18cfe480f73b04677139dee", [:rebar3], [{:certifi, "2.4.2", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "6.0.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "1.0.2", [hex: :mimerl, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.4", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm"},
"idna": {:hex, :idna, "6.0.0", "689c46cbcdf3524c44d5f3dde8001f364cd7608a99556d8fbd8239a5798d4c10", [:rebar3], [{:unicode_util_compat, "0.4.1", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm"},
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm"},

0 comments on commit 4b688b7

Please sign in to comment.