Tutorialspoint

Elixir Programming Examples

AGUNG IFB

defmodule Caesar_cipher do
  defp set_map(map, range, key) do
    org = Enum.map(range, &List.to_string [&1])
    {a, b} = Enum.split(org, key)
    Enum.zip(org, b ++ a) |> Enum.into(map)
  end
 
  def encode(text, key) do
    map = Map.new |> set_map(?a..?z, key) |> set_map(?A..?Z, key)
    String.graphemes(text) |> Enum.map_join(fn c -> Map.get(map, c, c) end)
  end
end
 
text = "AGUNG FHAJAR FADILAH IF-B CIANJUR"
key = 5
IO.puts "ASSALAMUALAIKUM WR.WB"
IO.puts "Original:  #{text}"
IO.puts "Encrypted: #{enc = Caesar_cipher.encode(text, key)}"
IO.puts "Decrypted: #{Caesar_cipher.encode(enc, -key)}"

Execute Elixir Online

naam = "Joost";

IO.puts(naam);

Execute Elixir Online

IO.puts "Hello, world!"

Hello World!

IO.puts "Hello, world!"
IO.puts "Nama                       : Umar Sani"
IO.puts "TTL                        : Pekalongan"
IO.puts "Asal Daerah                : Kabupaten Pekalongan, Jawa Tengah"
IO.puts "Motto                      : Be better, put my trust in Allah"
IO.puts "Alasan Memilih Informatika : Agar bisa mengembangkan diri"

Hello World!

IO.puts "Hello, world!"
IO.puts "Nama                       : Umar Sani"
IO.puts "TTL                        : Pekalongan"
IO.puts "Asal Daerah                : Kabupaten Pekalongan, Jawa Tengah"
IO.puts "Motto                      : Be better, put my trust in Allah"
IO.puts "Alasan Memilih Informatika : Agar bisa mengembangkan diri"

Hello World!

IO.puts "Hello, world!"
IO.puts "Nama                       : Umar Sani"
IO.puts "TTL                        : Pekalongan"
IO.puts "Asal Daerah                : Kabupaten Pekalongan, Jawa Tengah"
IO.puts "Motto                      : Be better, put my trust in Allah"
IO.puts "Alasan Memilih Informatika : Agar bisa mengembangkan diri"

Elixir Hello World Program

IO.puts "Hello, World!"
IO.puts "============"
IO.puts "Nama :"
IO.puts "Muhammad Wildan Athar"
IO.puts "TTL :"
IO.puts "Jakarta, 5 Juni 2000"

elixir

IO.puts "Hello world"
IO.puts "Nama :"
IO.puts "Muhammad Wildan Athar"

UIOP

IO.puts "Hello world"

Elixir-1

IO.puts "Hello, world!"

1 2 3 4 5 6 7 ... 10 Next
Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.