t6986.nim 389 B

1234567891011121314151617181920
  1. discard """
  2. targets: "cpp"
  3. action: "compile"
  4. """
  5. import sequtils, strutils
  6. when defined(nimPreviewSlimSystem):
  7. import std/syncio
  8. let rules = toSeq(lines("input"))
  9. .mapIt(it.split(" => ").mapIt(it.replace("/", "")))
  10. .mapIt((it[0], it[1]))
  11. proc pp(s: string): auto =
  12. toSeq(lines(s)).mapIt(it.split(" => ").mapIt(it.replace("/", ""))).mapIt((it[0], it[1]))
  13. echo pp("input")