hello all! 🙂
I am new here and I have a project that drives me crazy! (mostly because I have not coded for 2 years now...)
I am programming a simple lucky draw script where users have to select 4 numbers out of 16. I need to compare the selection made by the users to the winning numbers at the end of the competition.
for instance:
user 1: 01-03-11-14
user 2: 01-02-13-16
user 3: 02-14-08-16
user 4: 07-02-14-16
winning numbers: 07-16-14-02
so i need to record that:
user 1, 0 good number
user 2, 1 good number
user 3, 3 good numbers
user 4: all of them
order doesnt matter.
I have in the idea of exploding the array, storing each number as a different field and then checking each field for user 1, 2, 3 and 4 with the winning numbers.
the problem of such a thing is that it would take a longgggggggggggggg time to run given that apparently quite a lot of people are likely to play...
what would you suggest?
is there a script you know that compare such strings of characters and that I could use as a reference??
thanks!! 🙂
A.