I'm writing this question to maintain a register of design patterns associated with Scala, standards patterns or only from this language.
Associated questions:
Thanks to all who contribute
I'm writing this question to maintain a register of design patterns associated with Scala, standards patterns or only from this language.
Associated questions:
Thanks to all who contribute
//Triangle pattern using Scala:
object Exercise {
def main(args:Array [String]){
var n = 6
for (i<-1 to 6){
for (j<-i to (2*n-2))
{
print(" ")
}
for(j<- 0 to i-1)
{
print(" *")
}
println(" ")
}
}
}
Output: * * * * * * * * * * * * * * * * * * * * *