/elixir_bootcamp_cards

[bootcamp][elixir]

Primary LanguageElixir

Elixir bootcamp | Cards

Elixir basic crash course

Project outline

create_deck Create an array of playing cards
shuffle Shuffle an array of playing cards
deal Create a 'hand' of cards
contains? Given a deck and a single card, figure out if the cards is in the deck
save Save a collection of cards to a file on the local machine
load Load a collection of cards from the local machine

STEPS

step01 - create new project

$ mix new cards

$ cd cards

step02 - docs

$ mix deps.get

$ mix docs

$ mix test

$ firefox doc/index.html

step03 - Lists and String

$ iex -S mix

$ iex> Cards.create_deck

step04

$ recompile

$ deck = Cards.create_deck

$ Cards.shuffle(deck)

step05

$ recompile

Cards.contains?(deck, "Two")

step06

step08

Cards.save(deck, 'my_deck')