Reset array after playing the game?

后端 未结 2 1720
夕颜
夕颜 2021-01-24 08:35

I made a quiz in iOS with xcode, what i have now is a quiz that generates 20 random answers out of an array, it controls the text of the labels when a button is pushed to check

2条回答
  •  一生所求
    2021-01-24 09:01

    I see 2 options:

    you call the init line again...

    String *arrEurope[][2] =
    
    {
    
        {@"Eifel.jpg",@"Paris"},
        {@"NotreDame.jpg",@"Paris"},...
    

    Or you add a third row to your array and put the "removed" (i would call it "used") parameter there. In the last case you can then just iterate over your array again and put the "removed" back to "active"

提交回复
热议问题