small elixir learning exercise
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix typo

pfeyz 978df9d6 6a126f88

+10 -12
+2 -2
.gitignore
··· 20 20 *.ez 21 21 22 22 # Ignore package tarball (built via "mix hex.build"). 23 - tit_tac_toe-*.tar 23 + tic_tac_toe-*.tar 24 24 25 25 # Temporary files, for example, from tests. 26 26 /tmp/ 27 27 *~ 28 - \#* 28 + \#*
+2 -4
README.md
··· 1 - # TitTacToe 1 + # TicTacToe 2 2 3 3 A simple tic tac toe game in elixir. 4 - 5 - ## Installation 6 4 7 5 To see two random players play against each other, run: 8 6 ··· 14 12 - term: an interactive player providing moves via the terminal 15 13 - udp: a player that will send moves via udp packets 16 14 17 - for example, to make player X play via the terminal and player O play via upd: 15 + for example, to make player X play via the terminal and player O play via udp: 18 16 19 17 mix start_game term udp
+2 -2
lib/tit_tac_toe.ex
··· 3 3 use Mix.Task 4 4 5 5 @moduledoc """ 6 - Documentation for `TitTacToe`. 6 + Documentation for `TicTacToe`. 7 7 """ 8 8 9 9 @doc """ ··· 11 11 12 12 ## Examples 13 13 14 - iex> TitTacToe.hello() 14 + iex> TicTacToe.hello() 15 15 :world 16 16 17 17 """
+2 -2
mix.exs
··· 1 - defmodule TitTacToe.MixProject do 1 + defmodule TicTacToe.MixProject do 2 2 use Mix.Project 3 3 4 4 def project do 5 5 [ 6 - app: :tit_tac_toe, 6 + app: :tic_tac_toe, 7 7 version: "0.1.0", 8 8 elixir: "~> 1.16", 9 9 start_permanent: Mix.env() == :prod,
+2 -2
test/tit_tac_toe_test.exs
··· 1 - defmodule TitTacToeTest do 1 + defmodule TicTacToeTest do 2 2 use ExUnit.Case 3 - # doctest TitTacToe 3 + # doctest TicTacToe 4 4 5 5 def test_playthrough(%{players: players, winner: winner, board: board}) do 6 6 players = for {name, moves} <- players,