for completeness sake, a working version of the first example (helping the 
proof engine a bit)

still gonna give weave a try I guess
    
    
    import strutils
    import threadpool
    {.experimental: "parallel".}
    
    proc main =
      let
        w = 16
        h = 8
      var s = "a".repeat(w*h)
      parallel:
        ## not yet
        #for y in 0..<h:
        #  for x in 0..<w:
        #    s[y*w+x] = spawn chr(y*w+x)
        for i in 0..s.high:
          let
            x = i mod w
            y = i div w
          s[i] = spawn chr(y*w+x)
      echo s
    main()
    
    
    Run

Reply via email to