-1

I've got a problem with some code. While I was writing function to define variables in a table I had an "Extra argument 'at' in call" error. I was trying many, many things (including rewritting code from Udemy lesson) and sadly it is not working still.

Here's the code:

var tablica = [0,0,0,0,0,0]

func przypisywanie (position: Int) {
   tablica.insert(Int(arc4random() % 49) + 1, at: position ) {
   }
}

Thanks

Btw sorry if it is a silly question, but I'm complete beginner.

matt
  • 515,959
  • 87
  • 875
  • 1,141
Saq
  • 1

1 Answers1

1

Delete the extra curly braces:

var tablica = [0,0,0,0,0,0]

func przypisywanie (position: Int) {
    tablica.insert(Int(arc4random() % 49) + 1, at: position )
}
matt
  • 515,959
  • 87
  • 875
  • 1,141
  • I don’t know what “not working” means. The code in my answer compiles without error. – matt May 04 '19 at 22:33