Recursion...https://play.golang.org/p/vZpUalvGq3f


(Cherolyn Lexvold) #1

https://play.golang.org/p/vZpUalvGq3f

What does “n := factorial(4)” mean, specifically, (4)


(Ivan Matmati) #2

It’s just a function call. you pass 4 as argument to factorial function.


(Lutz Horn) #3

See the tour about functions.


(Cherolyn Lexvold) #4

This was helpful, One time I get lost is whenever the tour compares Go to C, because I know nothing about C. What I am beginning to do is skip over all the information about what C does and get back to what Go does


(Cherolyn Lexvold) #5

f func(func(int,int) int, int) int

Things like this ALMOST totally lose me

But i am determined


(Cherolyn Lexvold) #6

I realize this is necessary for most people studying Go so I’m not complaining, just noting


(Cherolyn Lexvold) #7

Thanks for directing me


(Cherolyn Lexvold) #8

Does the 4 here: n := factorial(4)
refer to the 4 in (4 * 3 * 2 * 1)?

Or is it a sepaate 4?


(Cherolyn Lexvold) #9

*separate


(Lutz Horn) #10

How about reading https://en.wikipedia.org/wiki/Factorial?

BTW, you can edit your post by clicking the ... button and then the pencil.


(Cherolyn Lexvold) #11

So is when the word factorial is invoked, does it result in an operation? Or is it an arbitrary identifier?

BTW, you can edit your post by clicking the ... button and then the pencil . Thanks!

[https://en.wikipedia.org/wiki/Factorial ] I looked this over and will do so again. My time is limited right now.


(system) closed #12

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.