diff -r 0e591f806290 -r 8a34b2ebc8cc progs/lecture1.scala --- a/progs/lecture1.scala Tue Dec 03 11:07:09 2019 +0000 +++ b/progs/lecture1.scala Mon Jan 27 10:18:13 2020 +0000 @@ -425,7 +425,17 @@ // - no vars, no ++i, no += // - no mutable data-structures (no Arrays, no ListBuffers) -// But what the heck.... +// But what the heck....lets try to count to 1 Mio in parallel + +var cnt = 0 + +for(i <- (1 to 1000000).par) cnt += 1 + +println(s"Should be 1 Mio: $cnt") + + + +// Or // Q: Count how many elements are in the intersections of // two sets? // A; IMPROPER WAY (mutable counter)