Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kortirso committed Nov 4, 2018
0 parents commit aa0e270
Show file tree
Hide file tree
Showing 10 changed files with 166 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .formatter.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Used by "mix format"
[
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
]
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# The directory Mix will write compiled artifacts to.
/_build/

# If you run "mix test --cover", coverage assets end up here.
/cover/

# The directory Mix downloads your dependencies sources to.
/deps/

# Where 3rd-party dependencies like ExDoc output generated docs.
/doc/

# Ignore .fetch files in case you like to edit your project deps locally.
/.fetch

# If the VM crashes, it generates a dump, let's ignore it too.
erl_crash.dump

# Also ignore archive artifacts (built via "mix archive.build").
*.ez

# Ignore package tarball (built via "mix hex.build").
chess-*.tar

35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# ChessGame

ChessGame package for playing chess, with game logics, validations.

## Installation

If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `chess` to your list of dependencies in `mix.exs`:

```elixir
def deps do
[
{:chess, "~> 0.0.1"}
]
end
```

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/kortirso/chess.

## License

The package is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

## Disclaimer

Use this package at your own peril and risk.

## Documentation

Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at [https://hexdocs.pm/chess](https://hexdocs.pm/chess).

30 changes: 30 additions & 0 deletions config/config.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file is responsible for configuring your application
# and its dependencies with the aid of the Mix.Config module.
use Mix.Config

# This configuration is loaded before any dependency and is restricted
# to this project. If another project depends on this project, this
# file won't be loaded nor affect the parent project. For this reason,
# if you want to provide default values for your application for
# 3rd-party users, it should be done in your "mix.exs" file.

# You can configure your application as:
#
# config :chess, key: :value
#
# and access this configuration in your application as:
#
# Application.get_env(:chess, :key)
#
# You can also configure a 3rd-party app:
#
# config :logger, level: :info
#

# It is also possible to import configuration files, relative to this
# directory. For example, you can emulate configuration per environment
# by uncommenting the line below and defining dev.exs, test.exs and such.
# Configuration from the imported file will override the ones defined
# here (which is why it is important to import them last).
#
# import_config "#{Mix.env()}.exs"
5 changes: 5 additions & 0 deletions lib/chess.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
defmodule Chess do
@moduledoc """
Main module for Chess
"""
end
16 changes: 16 additions & 0 deletions lib/chess/game.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
defmodule Chess.Game do
@moduledoc """
Game module
"""

defstruct squares: nil

alias Chess.{Game}

@doc """
Creates a game
"""
def new() do
%Game{}
end
end
41 changes: 41 additions & 0 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
defmodule Chess.MixProject do
use Mix.Project

@description """
Chess game
"""

def project do
[
app: :chess,
version: "0.0.1",
elixir: "~> 1.7",
name: "Chess",
description: @description,
source_url: "https://github.com/kortirso/chess",
start_permanent: Mix.env() == :prod,
deps: deps(),
package: package()
]
end

def application do
[
extra_applications: [:logger]
]
end

defp deps do
[
{:ex_doc, "~> 0.19", only: :dev}
]
end

defp package do
[
maintainers: ["Anton Bogdanov"],
licenses: ["MIT"],
links: %{"GitHub" => "https://github.com/kortirso/chess"}
]
end
end
7 changes: 7 additions & 0 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
%{
"earmark": {:hex, :earmark, "1.2.6", "b6da42b3831458d3ecc57314dff3051b080b9b2be88c2e5aa41cd642a5b044ed", [:mix], [], "hexpm"},
"ex_doc": {:hex, :ex_doc, "0.19.1", "519bb9c19526ca51d326c060cb1778d4a9056b190086a8c6c115828eaccea6cf", [:mix], [{:earmark, "~> 1.1", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.7", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm"},
"makeup": {:hex, :makeup, "0.5.5", "9e08dfc45280c5684d771ad58159f718a7b5788596099bdfb0284597d368a882", [:mix], [{:nimble_parsec, "~> 0.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm"},
"makeup_elixir": {:hex, :makeup_elixir, "0.10.0", "0f09c2ddf352887a956d84f8f7e702111122ca32fbbc84c2f0569b8b65cbf7fa", [:mix], [{:makeup, "~> 0.5.5", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm"},
"nimble_parsec": {:hex, :nimble_parsec, "0.4.0", "ee261bb53214943679422be70f1658fff573c5d0b0a1ecd0f18738944f818efe", [:mix], [], "hexpm"},
}
3 changes: 3 additions & 0 deletions test/chess_test.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
defmodule ChessTest do
use ExUnit.Case
end
1 change: 1 addition & 0 deletions test/test_helper.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ExUnit.start()

0 comments on commit aa0e270

Please sign in to comment.