OT: script to check Lotto numbers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear fellow Fedoreans,

I have some friends that play Lotto Texas and they buy tickets playing the same numbers every Wednesday and Saturday.  I subscribed to get the winning numbers.  If you match 3 or more numbers you are a winner.

The email has the following information
<Quote>

Texas Lottery - Lotto Texas - Winning Numbers for 10/10/2020

2 - 7 - 23 - 38 - 51 - 53

Lotto Texas Advertised Jackpot for 10/14/2020

Annuitized: $5.75 Million; Cash Value: $4.76 Million

</Quote>

The play 15 different sets of numbers and to check if they won any prize a script using a chain of if statements or case statements would be correct to implement this.  AWK may also do the job?
There are six numbers that we need to check let us suppose that we had the numbers in a file numbers.dat and it has the fifteen combinations

2 - 3 - 5 - 7 - 11 - 13
...
...
15 versions

Check against the winning numbers

2 - 7 - 23 - 38 - 51 - 53

Faster way to check compare string? Compare numbers one by one and check for at least 3

If (successful numbers >= 3)
  Write you have won $3
If (successful numbers >= 4)
  Write you have won $56
If (successful numbers >= 5)
 Write you have won $156
If (successful numbers > 5)
  Write you are a millionaire and have won the jackpot

The script will check for 3 or more numbers and write if we have winning numbers or not.  A bash script can do the job, or use AWK, grep or other commands.  I do not know if one uses (if commands or case commands)

Any pointers, tips are greatly appreciated.

Best Regards,


Antonio


Sent from ProtonMail, encrypted email based in Switzerland.

_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux