Home
Random
Log in
Settings
About Rosetta Code
Disclaimers
Rosetta Code
Search
Nested function: Difference between revisions
Page
Discussion
← Older edit
Newer edit →
Nested function
(view source)
Revision as of 07:14, 23 January 2017
104 bytes removed
,
7 years ago
→{{header|Scala}}
Revision as of 13:36, 19 January 2017
(
view source
)
Tejas
(
talk
|
contribs
)
(
→{{header|Scala}}
)
← Older edit
Revision as of 07:14, 23 January 2017
(
view source
)
Tejas
(
talk
|
contribs
)
(
→{{header|Scala}}
)
Newer edit →
Line 696:
<lang Scala>
def main(args: Array[String]) {
def
val
go(n
sep
:
Int):Unit
String
=
{
". "
var
if(n=
c:Int
=1
){
;
def
println
go
(
"1.
s:
first"
String
)
:Unit={
go
println
(
2
c+sep+s
)
}
c=c+1
if(n==1){
println("2. second")
▼
go(3)
}
if(n==1){
println("3. third")
▼
}
}
go(
1
"first"
)
▲
println
go
("
2.
second")
▲
println
go
("
3.
third")
}
</lang>
Tejas
3
edits