<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="279807" data-post-id="279807">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Sebb" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Sebb/120/21818_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Sebb
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="zoedsoupe" data-post="21" data-topic="54134">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zoedsoupe/48/25602_2.png" class="avatar"> zoedsoupe:</div>
<blockquote>
<p>it’s still failing on test cases.</p>
</blockquote>
</aside>
<p>can you show me those?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="279807" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/trying-to-implement-war-card-game-in-elixir/54134/22">Post #21</a>
	                </div>
	            </div>
              <div id="likers-container-279807" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="279807"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #21"></div>
  </section>
</div>
    <div class="postbit" id="279823" data-post-id="279823">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="zoedsoupe" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zoedsoupe/120/25602_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  zoedsoupe
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Sebb" data-post="20" data-topic="54134">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sebb/48/21818_2.png" class="avatar"> Sebb:</div>
<blockquote>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule War do
  import Enum

  @trace false

  def play(decks) do
    round_(:normal, decks, [])
  end

  defp round_(state, {deck_1, deck_2}, pot) do
    if @trace, do: dbg({state, {deck_1, deck_2}, pot})
    round(state, {deck_1, deck_2}, pot)
  end

  defp round(_, {[], []}, _), do: :draw
  defp round(_, {_, []}, _), do: :player_1
  defp round(_, {[], _}, _), do: :player_2

  defp round(:war, {[c, c1 | d1], [c, c2 | d2]}, pot) do
    round_(:war, {d1, d2}, pot ++ [c, c1, c, c2])
  end

  defp round(:war, {[c11, c12 | d1], [c21, c22 | d2]}, pot) do
    round_(:normal, decks(c11, c21, d1, d2, pot ++ [c11, c12, c21, c22]), [])
  end

  defp round(_, {[c | d1], [c | d2]}, pot) do
    round_(:war, {d1, d2}, pot ++ [c, c])
  end

  defp round(_, {[c1 | d1], [c2 | d2]}, pot) do
    round_(:normal, decks(c1, c2, d1, d2, [c1, c2]), pot)
  end

  defp decks(c1, c2, d1, d2, pot) do
    pot = sort(pot, :desc)
    if c1 &gt; c2, do: {d1 ++ pot, d2}, else: {d1, d2 ++ pot}
  end

  @set_of_cards to_list(2..14)
  defp deal(set_of_cards \\ @set_of_cards) do
    set_of_cards
    |&gt; List.duplicate(4)
    |&gt; List.flatten()
    |&gt; shuffle()
    |&gt; split(length(set_of_cards) * 2)
  end
end
</code></pre>
</blockquote>
</aside>
<p>Those test cases handle only the winner’s deck, so I modified your code a little</p>
<p>Here’s the code:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule War do
  import Enum

  @trace false

  defp play(decks) do
    round_(:normal, decks, [])
  end

  defp round_(state, {deck_1, deck_2}, pot) do
    if @trace, do: dbg({state, {deck_1, deck_2}, pot})
    round(state, {deck_1, deck_2}, pot)
  end

  defp round(_, {[], []}, _), do: :draw
  defp round(_, {p1, []}, _), do: p1
  defp round(_, {[], p2}, _), do: p2

  defp round(:war, {[c, c1 | d1], [c, c2 | d2]}, pot) do
    round_(:war, {d1, d2}, pot ++ [c, c1, c, c2])
  end

  defp round(:war, {[c11, c12 | d1], [c21, c22 | d2]}, pot) do
    round_(:normal, decks(c11, c21, d1, d2, pot ++ [c11, c12, c21, c22]), [])
  end

  defp round(_, {[c | d1], [c | d2]}, pot) do
    round_(:war, {d1, d2}, pot ++ [c, c])
  end

  defp round(_, {[c1 | d1], [c2 | d2]}, pot) do
    round_(:normal, decks(c1, c2, d1, d2, [c1, c2]), pot)
  end

  defp decks(c1, c2, d1, d2, pot) do
    pot = sort(pot, :desc)
    if c1 &gt; c2, do: {d1 ++ pot, d2}, else: {d1, d2 ++ pot}
  end

    defp apply_ace_weight(card) do
    (card == 1 &amp;&amp; 14) || card
  end

  defp remove_ace_weight(card) do
    (card == 14 &amp;&amp; 1) || card
  end

  def deal(deck) do
    deck
    |&gt; Enum.map(&amp;apply_ace_weight/1)
    |&gt; split(length(deck) * 2)
    |&gt; play()
    |&gt; case do
      xs when is_list(xs) -&gt; Enum.map(xs, &amp;remove_ace_weight/1)
      r -&gt; r
    end
  end
end

ExUnit.start()

defmodule WarTest do
    use ExUnit.Case

  describe "War" do
    test "deal_1" do
      t1 = [1,1,1,1,13,13,13,13,11,11,11,11,12,12,12,12,10,10,10,10,9,9,9,9,7,7,7,7,8,8,8,8,6,6,6,6,5,5,5,5,4,4,4,4,3,3,3,3,2,2,2,2]
      r1 = [1,1,1,1,13,13,13,13,12,12,12,12,11,11,11,11,10,10,10,10,9,9,9,9,8,8,8,8,7,7,7,7,6,6,6,6,5,5,5,5,4,4,4,4,3,3,3,3,2,2,2,2]
      assert War.deal(t1) == r1
    end

    test "deal_2" do
      t2 = [1,13,1,13,1,13,1,13,12,11,12,11,12,11,12,11,10,9,10,9,10,9,10,9,8,7,8,7,8,7,8,7,6,5,6,5,6,5,6,5,4,3,4,3,4,3,4,3,2,2,2,2]
      r2 = [4,3,2,2,2,2,4,3,4,3,4,3,6,5,6,5,6,5,6,5,8,7,8,7,8,7,8,7,10,9,10,9,10,9,10,9,12,11,12,11,12,11,12,11,1,13,1,13,1,13,1,13]
      assert War.deal(t2) == r2
    end

    test "deal_3" do
      t3 = [13,1,13,1,13,1,13,1,11,12,11,12,11,12,11,12,9,10,9,10,9,10,9,10,7,8,7,8,7,8,7,8,5,6,5,6,5,6,5,6,3,4,3,4,3,4,3,4,2,2,2,2]
      r3 = [4,3,2,2,2,2,4,3,4,3,4,3,6,5,6,5,6,5,6,5,8,7,8,7,8,7,8,7,10,9,10,9,10,9,10,9,12,11,12,11,12,11,12,11,1,13,1,13,1,13,1,13]
      assert War.deal(t3) == r3
    end

    test "deal_4" do
      t4 = [10,11,12,13,1,2,3,4,5,6,7,8,9,10,11,12,13,1,2,3,4,5,6,7,8,9,10,11,12,13,1,2,3,4,5,6,7,8,9,10,11,12,13,1,2,3,4,5,6,7,8,9]
      r4 = [1,1,13,12,9,5,11,4,9,3,8,7,7,2,13,10,12,5,10,4,9,6,8,3,1,1,13,12,7,5,11,4,9,3,8,6,7,2,13,10,12,5,11,11,10,8,6,4,6,3,2,2]
      assert War.deal(t4) == r4
    end

    test "deal_5" do
      t5 = [1,2,3,4,5,6,7,8,9,10,11,12,13,1,2,3,4,5,6,7,8,9,10,11,12,13,1,2,3,4,5,6,7,8,9,10,11,12,13,1,2,3,4,5,6,7,8,9,10,11,12,13]
      r5 = [1,10,13,8,11,9,8,7,11,8,13,7,13,6,12,6,9,5,8,5,7,4,7,4,11,6,12,10,6,3,2,2,12,5,9,3,10,4,9,2,10,3,5,2,1,1,1,13,12,11,4,3]
      assert War.deal(t5) == r5
    end

    defp create_deck do
      deck =
        for n &lt;- 1..13, _ &lt;- 1..4 do
          n
        end

      Enum.shuffle(deck)
    end

    test "should return the same number of cards after deal" do
      deck = create_deck()

      assert length(deck) == 52
      assert length(War.deal(deck)) == 52
    end

    test "should remove the ace weight after a win" do
      deck = create_deck()

      assert Enum.all?(War.deal(deck), &amp;(&amp;1 != 14))
    end
  end
end
</code></pre>
<p>And running with <code>elixir war.ex</code>:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  1) test War deal_5 (WarTest)
     war.ex:90
     Assertion with == failed
     code:  assert War.deal(t5) == r5
     left:  [
              1,
              2,
              3,
              4,
              5,
              6,
              7,
              8,
              9,
              10,
              11,
              12,
              13,
              1,
              2,
              3,
              4,
              5,
              6,
              7,
              8,
              9,
              10,
              11,
              12,
              13,
              1,
              2,
              3,
              4,
              5,
              6,
              7,
              8,
              9,
              10,
              11,
              12,
              13,
              1,
              2,
              3,
              4,
              5,
              6,
              7,
              8,
              9,
              10,
              11,
              12,
              13
            ]
     right: [
              1,
              10,
              13,
              8,
              11,
              9,
              8,
              7,
              11,
              8,
              13,
              7,
              13,
              6,
              12,
              6,
              9,
              5,
              8,
              5,
              7,
              4,
              7,
              4,
              11,
              6,
              12,
              10,
              6,
              3,
              2,
              2,
              12,
              5,
              9,
              3,
              10,
              4,
              9,
              2,
              10,
              3,
              5,
              2,
              1,
              1,
              1,
              13,
              12,
              11,
              4,
              3
            ]
     stacktrace:
       war.ex:93: (test)



  2) test War deal_2 (WarTest)
     war.ex:72
     Assertion with == failed
     code:  assert War.deal(t2) == r2
     left:  [
              1,
              13,
              1,
              13,
              1,
              13,
              1,
              13,
              12,
              11,
              12,
              11,
              12,
              11,
              12,
              11,
              10,
              9,
              10,
              9,
              10,
              9,
              10,
              9,
              8,
              7,
              8,
              7,
              8,
              7,
              8,
              7,
              6,
              5,
              6,
              5,
              6,
              5,
              6,
              5,
              4,
              3,
              4,
              3,
              4,
              3,
              4,
              3,
              2,
              2,
              2,
              2
            ]
     right: [
              4,
              3,
              2,
              2,
              2,
              2,
              4,
              3,
              4,
              3,
              4,
              3,
              6,
              5,
              6,
              5,
              6,
              5,
              6,
              5,
              8,
              7,
              8,
              7,
              8,
              7,
              8,
              7,
              10,
              9,
              10,
              9,
              10,
              9,
              10,
              9,
              12,
              11,
              12,
              11,
              12,
              11,
              12,
              11,
              1,
              13,
              1,
              13,
              1,
              13,
              1,
              13
            ]
     stacktrace:
       war.ex:75: (test)



  3) test War deal_3 (WarTest)
     war.ex:78
     Assertion with == failed
     code:  assert War.deal(t3) == r3
     left:  [
              13,
              1,
              13,
              1,
              13,
              1,
              13,
              1,
              11,
              12,
              11,
              12,
              11,
              12,
              11,
              12,
              9,
              10,
              9,
              10,
              9,
              10,
              9,
              10,
              7,
              8,
              7,
              8,
              7,
              8,
              7,
              8,
              5,
              6,
              5,
              6,
              5,
              6,
              5,
              6,
              3,
              4,
              3,
              4,
              3,
              4,
              3,
              4,
              2,
              2,
              2,
              2
            ]
     right: [
              4,
              3,
              2,
              2,
              2,
              2,
              4,
              3,
              4,
              3,
              4,
              3,
              6,
              5,
              6,
              5,
              6,
              5,
              6,
              5,
              8,
              7,
              8,
              7,
              8,
              7,
              8,
              7,
              10,
              9,
              10,
              9,
              10,
              9,
              10,
              9,
              12,
              11,
              12,
              11,
              12,
              11,
              12,
              11,
              1,
              13,
              1,
              13,
              1,
              13,
              1,
              13
            ]
     stacktrace:
       war.ex:81: (test)

.

  4) test War deal_1 (WarTest)
     war.ex:66
     Assertion with == failed
     code:  assert War.deal(t1) == r1
     left:  [
              1,
              1,
              1,
              1,
              13,
              13,
              13,
              13,
              11,
              11,
              11,
              11,
              12,
              12,
              12,
              12,
              10,
              10,
              10,
              10,
              9,
              9,
              9,
              9,
              7,
              7,
              7,
              7,
              8,
              8,
              8,
              8,
              6,
              6,
              6,
              6,
              5,
              5,
              5,
              5,
              4,
              4,
              4,
              4,
              3,
              3,
              3,
              3,
              2,
              2,
              2,
              2
            ]
     right: [
              1,
              1,
              1,
              1,
              13,
              13,
              13,
              13,
              12,
              12,
              12,
              12,
              11,
              11,
              11,
              11,
              10,
              10,
              10,
              10,
              9,
              9,
              9,
              9,
              8,
              8,
              8,
              8,
              7,
              7,
              7,
              7,
              6,
              6,
              6,
              6,
              5,
              5,
              5,
              5,
              4,
              4,
              4,
              4,
              3,
              3,
              3,
              3,
              2,
              2,
              2,
              2
            ]
     stacktrace:
       war.ex:69: (test)



  5) test War deal_4 (WarTest)
     war.ex:84
     Assertion with == failed
     code:  assert War.deal(t4) == r4
     left:  [
              10,
              11,
              12,
              13,
              1,
              2,
              3,
              4,
              5,
              6,
              7,
              8,
              9,
              10,
              11,
              12,
              13,
              1,
              2,
              3,
              4,
              5,
              6,
              7,
              8,
              9,
              10,
              11,
              12,
              13,
              1,
              2,
              3,
              4,
              5,
              6,
              7,
              8,
              9,
              10,
              11,
              12,
              13,
              1,
              2,
              3,
              4,
              5,
              6,
              7,
              8,
              9
            ]
     right: [
              1,
              1,
              13,
              12,
              9,
              5,
              11,
              4,
              9,
              3,
              8,
              7,
              7,
              2,
              13,
              10,
              12,
              5,
              10,
              4,
              9,
              6,
              8,
              3,
              1,
              1,
              13,
              12,
              7,
              5,
              11,
              4,
              9,
              3,
              8,
              6,
              7,
              2,
              13,
              10,
              12,
              5,
              11,
              11,
              10,
              8,
              6,
              4,
              6,
              3,
              2,
              2
            ]
     stacktrace:
       war.ex:87: (test)


Finished in 0.03 seconds (0.03s on load, 0.00s async, 0.00s sync)
7 tests, 5 failures
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="279823" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/trying-to-implement-war-card-game-in-elixir/54134/23">Post #22</a>
	                </div>
	            </div>
              <div id="likers-container-279823" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="279823"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #22"></div>
  </section>
</div>
    <div class="postbit" id="279855" data-post-id="279855">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Sebb" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Sebb/120/21818_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Sebb
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Where are these tests from?<br>
I do not see anything about an “ace weight” in the requirements.</p>
<p>What I did not consider is that the deck comes in already shuffled.<br>
Its not clear to me whats happening here:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">test "deal_4" do
      t4 = [10,11,12,13 ...]
      r4 = [1,1,13,12,9 ....]
      assert War.deal(t4) == r4
    end
</code></pre>
<p>what does <code>deal</code> do? It gets one list and returns it shuffled as it seems. How is that useful, how should that be testable?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="279855" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/trying-to-implement-war-card-game-in-elixir/54134/24">Post #23</a>
	                </div>
	            </div>
              <div id="likers-container-279855" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="279855"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #23"></div>
  </section>
</div>
    <div class="postbit" id="279860" data-post-id="279860">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="zoedsoupe" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zoedsoupe/120/25602_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  zoedsoupe
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Sebb" data-post="24" data-topic="54134">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sebb/48/21818_2.png" class="avatar"> Sebb:</div>
<blockquote>
<p>Where are these tests from?</p>
</blockquote>
</aside>
<p>These tests already exist! They were provided to me</p>
<aside class="quote no-group" data-username="Sebb" data-post="24" data-topic="54134">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sebb/48/21818_2.png" class="avatar"> Sebb:</div>
<blockquote>
<p>what does <code>deal</code> do?</p>
</blockquote>
</aside>
<p>The deal function receives a shuffled deck and returns the winner’s deck.</p>
<aside class="quote no-group" data-username="Sebb" data-post="24" data-topic="54134">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sebb/48/21818_2.png" class="avatar"> Sebb:</div>
<blockquote>
<p>I do not see anything about an “ace weight” in the requirements.</p>
</blockquote>
</aside>
<p>The ace weight is needed because the provided shuffled deck has aces as 1, but it needs to be the highest rank</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="279860" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/trying-to-implement-war-card-game-in-elixir/54134/25">Post #24</a>
	                </div>
	            </div>
              <div id="likers-container-279860" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="279860"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #24"></div>
  </section>
</div>
    <div class="postbit" id="279865" data-post-id="279865">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Sebb" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Sebb/120/21818_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Sebb
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>OK, great naming… not.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">|&gt; split(length(deck) * 2)
</code></pre>
<blockquote>
<p>The game starts with a shuffled deck of cards. The deck will be passed into your program already shuffled (details below). The cards are <strong>dealt in an alternating fashion</strong> to each player, so that each player has 26 cards.</p>
</blockquote>
<p>I did just split the deck in two, because the alternated dealing does not add randomness. But if you get the deck from the test you have to do it, otherwise this cant succeed.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="279865" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/trying-to-implement-war-card-game-in-elixir/54134/26">Post #25</a>
	                </div>
	            </div>
              <div id="likers-container-279865" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="279865"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #25"></div>
  </section>
</div>
    <div class="postbit" id="279973" data-post-id="279973">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="zoedsoupe" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zoedsoupe/120/25602_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  zoedsoupe
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>the deck from tests are already shuffled</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="279973" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/trying-to-implement-war-card-game-in-elixir/54134/27">Post #26</a>
	                </div>
	            </div>
              <div id="likers-container-279973" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="279973"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #26"></div>
  </section>
</div>
    <div class="postbit" id="279975" data-post-id="279975">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Sebb" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Sebb/120/21818_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Sebb
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>yes, but feeding <code>play</code> with</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">iex(1)&gt; [1,2,3,4] |&gt; Enum.split(2)
{[1, 2], [3, 4]}
</code></pre>
<p>and</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">iex(2)&gt; {[1,2,3,4] |&gt; Enum.take_every(2), [1,2,3,4] |&gt; Enum.drop_every(2)}
{[1, 3], [2, 4]}
</code></pre>
<p>will yield different results.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="279975" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/trying-to-implement-war-card-game-in-elixir/54134/28">Post #27</a>
	                </div>
	            </div>
              <div id="likers-container-279975" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="279975"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #27"></div>
  </section>
</div>
    <div class="postbit" id="279983" data-post-id="279983">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="zoedsoupe" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zoedsoupe/120/25602_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  zoedsoupe
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>yes, of course! the decks needs to be splitter by the second way</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="279983" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/trying-to-implement-war-card-game-in-elixir/54134/29">Post #28</a>
	                </div>
	            </div>
              <div id="likers-container-279983" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="279983"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #28"></div>
  </section>
</div>
    <div class="postbit" id="280815" data-post-id="280815">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="zoedsoupe" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zoedsoupe/120/25602_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  zoedsoupe
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I tried to dig on these test cases but no success <img src="https://forum.elixirforum.com/images/emoji/apple/confused.png?v=15" title=":confused:" class="emoji" alt=":confused:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="280815" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/trying-to-implement-war-card-game-in-elixir/54134/30">Post #29</a>
	                </div>
	            </div>
              <div id="likers-container-280815" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="280815"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #29"></div>
  </section>
</div>
    <div class="postbit" id="280829" data-post-id="280829">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Sebb" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Sebb/120/21818_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Sebb
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>how does your deal function look like now?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="280829" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/trying-to-implement-war-card-game-in-elixir/54134/31">Post #30</a>
	                </div>
	            </div>
              <div id="likers-container-280829" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="280829"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #30"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/54134/load_more?page=4">Load more posts (11 remaining)</a>
</div></template></turbo-stream>