Thank you for your feedback! I just ran the code and found no measurable change?
Your function being getnbs2, minus two ) at the end of the first row, was there something there?
Obviously I misunderstood the purpose of this discussion. I thought it was also about not so serious things you can do in Julia. Well, what I like about Julia is that it is up to the programmer, to decide, whether he needs to be smart or not. Anyway, thank you for Combinatorics.permutations.
I don’t think you misunderstood. But in spite of the levity of the subject, I think it should be OK to point it out if a piece of code can actually give the wrong answer. Especially if there is a correct way that is even more elegant.
As the time passed I’ve come to realize that multiple dispatch " is a wonderful gift which we neither understand , nor deserve". Just imagine if there was a unique “plus” sign for each addition operation in mathematics: one for interegs, other for real numbers (different entities – so use different operations!), one for monomials, one for polynomials etc etc. As I think, the great progress in our understanding of the world is that there is very concise language to represent the fenomena – and Julia with its multiple dispatch is right in the middle of this " Das Glasperlenspiel"
Learning Python is easy too but I was never ever confident of what I was learning. Am I learning tricks or principles? With Julia, I consistently get the sense that there are some basic principles that apply for any code you write. Ultimately, I think it is not so much about the learning curve either: what you are learning matters a lot more. Are you learning to work around things or are you learning a tool to achieve more? Good programming languages should make things easy for not so good programmers. This is where Julia shines.
n=4
randcoord=[collect(i) for i in zip(rand(0:20,n),rand(0:20,n))]
randcoord is a Vector{Array{Int64,1}} with 4 elements
Vector{Int64} with 2 elements
9
9
Vector{Int64} with 2 elements
8
5
Vector{Int64} with 2 elements
8
17
Vector{Int64} with 2 elements
10
5
Ok thanks you!
this is better , sorry for my poor example then ;).
note: you get the matrix lines by using M[1,:] , M[2,:] …( where M is the matrix)
the format is still slightly different but still usable.