title: Generate a list with lambdas in kotlin
body: <p>I'm new to Kotlin and lambdas and I'm trying to understand it. I'm trying to generate a list of 100 random numbers. 
  This works:</p>
  
  <pre><code>private val maxRandomValues = (1..100).toList()
  </code></pre>
  
  <p>But I want to do something like that:</p>
  
  <pre><code>private val maxRandomValues = (1..100).forEach { RandomGenerator().nextDouble() }.toList()
  </code></pre>
  
  <p>But this is not working. I'm trying to figure out how to use the values generated into <code>forEach</code> are used in the <code>toList()</code></p>