Hello! I'm not a programmer but I found app inventor and I decided to begine a "simple" project for learning on my own.. So I'd like to create an app for lottery every week . So I have done the registration and login platform , I have connected the app with firebase and auth firebase, but I don't know how to create a lottery. Every user have to select only one number every week for this .I've tried a lot but i have no idea how to continue. Please if someone have an idea , let me know. This is what i have done until now
So users are only allowed to pick one number per lottery, and are not allowed to change it afterwards before announcement of the winning number?
I would recommend this data structure in Firebase:
- 2021-09
- ABG
- 43
- 111386
- 234
- ABG
- 2021-10 (year-week number, look in advanced Clock date formatting)
- ABG
- 423
- 111386
- 23
- ABG
thank you so much for your recommendation! You're right about the number picking.. but I don't undestand the data structure and how I could write this structure..
This data structure is designed to enforce the rule of one lottery per week of year, and only one choice per name per lottery (week).
Try using these tags and values for your writes to FireBase:
Tag: '2021-10/ABG'
Value: 423
Tag: '2021-10/111386'
Value: 23
By the way, this structure maintains the two rules efficiently by space and by speed of checking for duplicates.
However, it pays a price when it comes time to see who bet on the winning number. You have to ask for all the tags and values and go through them one by one.
But that only needs to happen once.
Thank you!!! I will try!!
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.