Hi.
If you just need to check for duplicates in an array, you do it the same way as in other programming languages—using temporary variables and a loop.
But I see that you’ve included a choice of three rewards, just like in modern roguelikes.
We’ve already discussed this here and even provided examples—but in this case, you need not only to detect duplicates but also to award new bonuses or increase the level of existing ones.
I can’t find that thread, but I’ll give you the examples I’ve saved.
fex.net/uk/s/t3cyssb