4 points by Conor Mar 27, 2023 | flag | 2 comments
vermorel Mar 28, 2023 | flag

I have just updated Supply Chain News to pretty print Envision scripts as well. Here is the first script:


montecarlo 1000 with // approximate π value
  x = random.uniform(-1, 1)
  y = random.uniform(-1, 1)
  inCircle = x^2 + y^2 < 1
  sample approxPi = avg(if inCircle then 4 else 0)
show scalar "π approximation" with approxPi // 3.22

vermorel Mar 28, 2023 | flag

By the way, mathematical formulas are pretty-printed as well:

$$ \phi = \frac{1 + \sqrt{5}}{2} $$