<% alias BattleSnake.Snake %>
<div>
  <% width = @world.width %>
  <% height = @world.height %>
  <div style="display: flex">
    <%= content_tag :svg, height: "100%", width: "100%", viewBox: "0 0 #{width} #{height}" do %>
      <%# background %>
      <%= content_tag :rect, "", y: 0, x: 0, width: width, height: height, fill: "lightgrey" %>

      <%= for snake <- @world.snakes, point <- snake.coords do %>
        <%=
          content_tag :rect, "",
          y: point.y,
          x: point.x,
          width: 1,
          height: 1,
          fill: :red
        %>
      <% end %>

      <%= for food <- @world.food do %>
        <%=
          content_tag :rect, "",
          y: food.y,
          x: food.x,
          width: 1,
          height: 1,
          fill: :green
        %>
      <% end %>
    <% end %>

    <div>
      <%= for snake <- @world.snakes do %>
        <dl>
          <dd>url</dd>
          <%= content_tag :dt, snake.url %>
          <dd>length</dd>
          <%= content_tag :dt, Snake.len(snake) %>
          <dd>move</dd>
          <%= content_tag :dt, @world.moves[snake.name] %>
        </dl>
      <% end %>
    </div>
  </div>
</div>

<% alias BattleSnake.Snake %>
<div>
  <% width = @world.width %>
  <% height = @world.height %>
  <div style="display: flex">
    <%= content_tag :svg, height: "100%", width: "100%", viewBox: "0 0 #{width} #{height}" do %>
      <%# background %>
      <%= content_tag :rect, "", y: 0, x: 0, width: width, height: height, fill: "lightgrey" %>

      <%= for snake <- @world.snakes, point <- snake.coords do %>
        <%=
          content_tag :rect, "",
          y: point.y,
          x: point.x,
          width: 1,
          height: 1,
          fill: snake.color
        %>
      <% end %>

      <%= for food <- @world.food do %>
        <%=
          content_tag :rect, "",
          y: food.y,
          x: food.x,
          width: 1,
          height: 1,
          fill: :green
        %>
      <% end %>
    <% end %>

    <div>
      <%= for snake <- @world.snakes do %>
        <dl>
          <dd>url</dd>
          <%= content_tag :dt, snake.url %>
          <dd>length</dd>
          <%= content_tag :dt, Snake.len(snake) %>
          <dd>move</dd>
          <%= content_tag :dt, @world.moves[snake.name] %>
        </dl>
      <% end %>
    </div>
  </div>
</div>

Use snake's color on the board
Use snake's color on the board
