Functional Web Development with Elixir, OTP, and Phoenix: Rethink the Modern Web App by Lance Halvorsen
Author:Lance Halvorsen [Halvorsen, Lance]
Language: eng
Format: epub, pdf
Tags: Pragmatic Bookshelf
Publisher: Pragmatic Bookshelf
Published: 2018-01-25T00:00:00+00:00
iex> state_data = :sys.replace_state(game, fn data ->
...> %{state_data | rules: %Rules{state: :player1_turn}}
...> end)
. . .
iex> state_data.rules.state
:player1_turn
Let’s have :player1 guess a wrong coordinate. The response we get should be {:miss, :none, :no_win}:
iex> Game.guess_coordinate(game, :player1, 5, 5)
{:miss, :none, :no_win}
That’s perfect.
If :player1 tries to guess again, the rules should catch that and return :error:
iex> Game.guess_coordinate(game, :player1, 3, 1)
:error
Excellent! That was just what we expected.
If :player2 guesses the single coordinate in :dot island, he should win the game:
iex> Game.guess_coordinate(game, :player2, 1, 1)
{:hit, :dot, :win}
That’s exactly what happens.
With that, we’ve defined the interface and all the behavior we’ll need from the Game module. The last thing we’ll need is to be able to address each game process by name in the system.
Download
Functional Web Development with Elixir, OTP, and Phoenix: Rethink the Modern Web App by Lance Halvorsen.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7779)
Grails in Action by Glen Smith Peter Ledbrook(7696)
Configuring Windows Server Hybrid Advanced Services Exam Ref AZ-801 by Chris Gill(6559)
Azure Containers Explained by Wesley Haakman & Richard Hooper(6545)
Running Windows Containers on AWS by Marcio Morales(6074)
Kotlin in Action by Dmitry Jemerov(5064)
Microsoft 365 Identity and Services Exam Guide MS-100 by Aaron Guilmette(4913)
Combating Crime on the Dark Web by Nearchos Nearchou(4495)
Management Strategies for the Cloud Revolution: How Cloud Computing Is Transforming Business and Why You Can't Afford to Be Left Behind by Charles Babcock(4414)
Microsoft Cybersecurity Architect Exam Ref SC-100 by Dwayne Natwick(4331)
The Ruby Workshop by Akshat Paul Peter Philips Dániel Szabó and Cheyne Wallace(4168)
The Age of Surveillance Capitalism by Shoshana Zuboff(3950)
Python for Security and Networking - Third Edition by José Manuel Ortega(3736)
Learn Windows PowerShell in a Month of Lunches by Don Jones(3508)
The Ultimate Docker Container Book by Schenker Gabriel N.;(3405)
Mastering Python for Networking and Security by José Manuel Ortega(3344)
Mastering Azure Security by Mustafa Toroman and Tom Janetscheck(3330)
Blockchain Basics by Daniel Drescher(3294)
Learn Wireshark by Lisa Bock(3254)
