Skip to content
Elixir TCP Server practice
Elixir Ruby
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
priv/ruby
stories
test
.formatter.exs
.gitignore
README.md
mix.exs
mix.lock

README.md

Elixir MUD

Use Ruby as DSL backend to generate story and handle TCP connection by Elixir

Installation

Use mix deps.get to install

Usage

Start server by mix run --no-halt

Connect to game by telnet localhost 6666

Write Story in Ruby

# stories/chapter1.rb

# Create a chapter
chapter 1 do
  # Create an action
  action do # Index: 0
    say "Hi, Welcome to Elixir.MUD" # Print message
    say "Do you want to continue?(Y/n)"
    jump 1 # Jump to Index: 1
    wait_input # Display "> " to user
  end

  action do # Index: 1
    say "Cool, you learned how to create a MUD"
    close # Close connection to end the game
  end
end
You can’t perform that action at this time.