Update ArtificialNeuralNetwork.scala

Replaced fors by whiles