rpg-character-sheet

This commit is contained in:
2023-12-18 14:19:33 -05:00
parent a4a5085d00
commit b69dc97356
11 changed files with 471 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
defmodule RPG.CharacterSheet do
def welcome() do
IO.puts("Welcome! Let's fill out your character sheet together.")
end
def ask_name() do
IO.gets("What is your character's name?\n")
|> String.trim()
end
def ask_class() do
IO.gets("What is your character's class?\n")
|> String.trim()
end
def ask_level() do
IO.gets("What is your character's level?\n")
|> String.trim()
|> String.to_integer()
end
def run() do
welcome()
%{}
|> Map.put(:name, ask_name())
|> Map.put(:class, ask_class())
|> Map.put(:level, ask_level())
|> IO.inspect(label: "Your character")
end
end