This Scala tutorial, called "The Neophyte’s Guide to Scala" can be considered as an auxiliary resource of #progfun. It is particularly good at getting started with Scala, and to delve
Problem Definition
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143?
Source: https://projecteuler.net/problem=3
Solution
object Euler03 {
type
Pattern matching lets you automatically execute code based on some piece of data. Scala uses pattern matching often, such as when you parse XML or pass messages between threads. Basic syntax of pattern
In Scala, an instance of Set can be declared as follows.
val s = (1 to 6).toSet
Principle difference between sets and sequences are three:
* Sets are unordered
val s = (1 to 6)