Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Toy Alchemist (workshop)

The Toy Alchemist (workshop)

”The Toy Robot” is an interview exercise where you build a simulation of a toy robot moving around a square tabletop through a series of move commands. You can’t let the robot fall off the board!

In the workshop, we will build this game using the Elixir language and functional programming paradigms. We are not going to jump right in but rather start with the basics of Elixir and build up from there. Get a deep head start!

The implementation can be found at https://github.com/jwright/toy_alchemist

Elixir needs more alchemists.

Jamie Wright

May 25, 2023
Tweet

More Decks by Jamie Wright

Other Decks in Programming

Transcript

  1. TOY ALCHEMIST
    game program™
    Use with Workshop Wizards
    ELIXIR NDCOSLO

    View full-size slide

  2. Jamie Wright
    background

    View full-size slide

  3. Jamie Wright
    background Proudly made
    in the 80’s

    View full-size slide

  4. Jamie Wright
    background Proudly made
    in the 80’s
    Started using
    Elixir in
    2014

    View full-size slide

  5. Jamie Wright
    background Proudly made
    in the 80’s
    Started using
    Elixir in
    2014
    Now building
    in it daily

    View full-size slide

  6. Jamie Wright
    background Proudly made
    in the 80’s
    Started using
    Elixir in
    2014
    Now building
    in it daily
    My favorite
    language

    View full-size slide

  7. Jamie Wright
    background Proudly made
    in the 80’s
    Started using
    Elixir in
    2014
    Now building
    in it daily
    Working on
    Juvet (OSS
    MVC chatbot
    framework)
    My favorite
    language

    View full-size slide

  8. Jamie Wright
    background
    @jwright
    [email protected]
    T
    g

    View full-size slide

  9. speakerdeck.com/jwright
    slides

    View full-size slide

  10. The TOY ROBOT
    storytime

    View full-size slide

  11. The TOY ROBOT
    storytime

    View full-size slide

  12. The TOY ROBOT
    storytime
    PLACE 2,3,EAST

    View full-size slide

  13. The TOY ROBOT
    storytime
    RIGHT

    View full-size slide

  14. The TOY ROBOT
    storytime
    MOVE

    View full-size slide

  15. The TOY ROBOT
    storytime
    MOVE

    View full-size slide

  16. The TOY ROBOT
    storytime
    MOVE

    View full-size slide

  17. The TOY ROBOT
    storytime
    LEFT

    View full-size slide

  18. The TOY ROBOT
    storytime
    MOVE

    View full-size slide

  19. The TOY ROBOT
    storytime
    AT 1,1 FACING WEST

    View full-size slide

  20. The TOY ROBOT
    storytime
    ALCHEMIST
    AT 1,1 FACING WEST
    🧙

    View full-size slide

  21. solution
    workshop
    github.com/jwright/toy_alchemist

    View full-size slide

  22. book
    workshop
    leanpub.com/elixir-toyrobot

    View full-size slide

  23. demo
    workshop

    View full-size slide

  24. Elixir
    background

    View full-size slide

  25. Elixir
    background

    View full-size slide

  26. Elixir
    background
    Erlang
    Released
    1986

    View full-size slide

  27. Elixir
    background
    Erlang
    Released
    BEAM
    1986 1992

    View full-size slide

  28. Elixir
    background
    Erlang
    Released
    BEAM Elixir
    Released
    1986 1992 2012

    View full-size slide

  29. Elixir
    background
    Erlang
    Released
    BEAM Elixir
    Released
    Phoenix
    Released
    1986 1992 2012 2015

    View full-size slide

  30. Elixir
    background
    Erlang
    Released
    BEAM Elixir
    Released
    Phoenix
    Released
    LiveView
    1986 1992 2012 2015 2019

    View full-size slide

  31. Elixir
    background
    Erlang
    Released
    BEAM Elixir
    Released
    Phoenix
    Released
    LiveView
    LiveBook
    1986 1992 2012 2015 2019 2021

    View full-size slide

  32. Elixir
    background
    Erlang
    Released
    BEAM Elixir
    Released
    Phoenix
    Released
    LiveView
    LiveBook
    Nx
    1986 1992 2012 2015 2019 2021 2022

    View full-size slide

  33. Elixir
    background
    Erlang
    Released
    BEAM Elixir
    Released
    Phoenix
    Released
    LiveView
    LiveBook
    Nx
    Bumblebee
    1986 1992 2012 2015 2019 2021 2022

    View full-size slide

  34. Functional
    lesson

    View full-size slide

  35. Functional
    lesson

    View full-size slide

  36. Functional
    lesson

    View full-size slide

  37. Modules + Functions
    lesson

    View full-size slide

  38. Modules + Functions
    lesson
    Module

    View full-size slide

  39. Modules + Functions
    lesson
    Functions
    Module

    View full-size slide

  40. Create the project
    workshop

    View full-size slide

  41. ExUnit
    lesson

    View full-size slide

  42. Break down the problem
    workshop

    View full-size slide

  43. Structs
    lesson

    View full-size slide

  44. Structs
    lesson
    Struct

    View full-size slide

  45. Structs vs. Maps
    lesson

    View full-size slide

  46. Structs vs. Maps
    lesson

    View full-size slide

  47. Structs vs. Maps
    lesson

    View full-size slide

  48. Pattern Matching
    lesson

    View full-size slide

  49. Pipe operator
    lesson

    View full-size slide

  50. Pipe operator
    lesson

    View full-size slide

  51. Pipe operator
    lesson

    View full-size slide

  52. Docs + Doctest
    lesson

    View full-size slide

  53. Case statement
    lesson

    View full-size slide

  54. Tuples
    lesson

    View full-size slide