Task

Using either native language concurrency syntax or freely available libraries, write a program to display the strings "Enjoy" "Rosetta" "Code", one string per line, in random order.

Concurrency syntax must use threads, tasks, co-routines, or whatever concurrency is called in your language.




defmodule Concurrent do
  def computing(xs) do
    Enum.each(xs, fn x ->
      spawn(fn ->
        Process.sleep(:rand.uniform(1000))
        IO.puts x
      end)
    end)
    Process.sleep(1000)
  end
end
 
Concurrent.computing ["Enjoy", "Rosetta", "Code"]