News for hackers. Stuff that matters.
Re:How do I modify a variable in Haskell? by pmarreck on Tuesday August 15, 2017 @12:29PM (#15019685)
not that this is code golf, and not that the following is even mutation, but I couldn't help trying out the "for" syntax in Elixir, which this seemed like a good job for:

    one_or_zero = fn(x,y) -> if x==y, do: "1", else: "0" end
    for i <- 1..10 do
      for j <- 1..10 do
        one_or_zero.(i,j) |> IO.write
      end
      IO.write("\n")
    end

There are no comments on this comment yet.