@crami25 Hello again. I have redone all the sorting/tipping/drawing stuff. And now the code works as I wanted it. Code is not optimized for size but seems to work. I posted the new code here https://pastebin.com/fq7AVKrG
NOW the "random" numbers are "random" even with "tweaks" actives. Thanks for your support and help. Any sugestions/remarks are welcome as always.
blackphoenixpt
@blackphoenixpt
Posts made by blackphoenixpt

RE: m5stack EuroMillions APP help

RE: m5stack EuroMillions APP help
@crami25 Hello. Strange the "exit" it should be "break" and it should be NOTHING. I don't know WHY I put the exit there. Just remove it.. Sorry for that mistake. The idea is exiting the sub. Have you found anything else weird? What about the random numbers drawing scheme? It's weird that with no "tweaking" numbers are drawn "random" values and with "tweaking" they repeat themselves. You can only see this if you upload the source to an m5stack. Thank you

RE: m5stack EuroMillions APP help
@crami25 Hello. After analysing the code do you see any flaw? WHY does the code draw random numbers if the tweaks are 00 and numbers are almot the same drawn if tweaks are different than 00? That puzzles me. Any thought on that? Have you upload the prog to your m5 and saw the strange behaviour? Thank for your help.

RE: m5stack EuroMillions APP help
@crami25 Hello. Thanks. Sorta was used for TIP. 2 ... +2 will be dificult to explain. It only make sense if the number DRAWN if at lenght of 2 or 2 of the number TIPPED. Forget that. What puzzle me (and you can only see it if you put the program in your m5stack) if when all options are "00" numbers are drawn randmly but if you change any of the options to 2 ... 2, the numbers are repeating. It's weird. Can you put the program in your m5 and explain the weird behaviour? Thanks

RE: m5stack EuroMillions APP help
@crami25 Hello. Thank you for replying. The system of the 2..+2 is simple. A number random is sorted: 5 for exemple. I play EuroMillion with that number and 4 more sorted. The next week the numbers sorted are displayed and I realise that "6" has been sorted instead of "5" (the number I played the week before. Simce numbers from 1 to 6 are in the row 1 of the EuroMillion form, I go to OPTIONS and select "+1" in row 1. NOW, if a number is sorted like "3" for exemple, the program is showing me 3+(+1)=4. You get the idea? All rows have that tweak (all but not last row 49..50). Those "tweaks numbers" are saved in eeprom so everytime I start the app the tweak numbers are as I want them. THE BATERY, since I was using the m5stack for this app I thought that it will be nice to see HOW MUCH battery is remaining. KEYPRESSED are not random. I wait for keypress and depending WHERE in the program I AM (I mean what SUB is active). I haven't managed to save negative values as byte (signed char in this case) in eprom so I convert the values of the ROW TWEAKS from 2 to +2 into a simple 1 to 5 system and do the inverse when Reading eprom. The sorting is Bubble sort but doesn't seem to work and THAT is a weird problema. I hope I have dissipate all your doubs so you can try to help. Thanks

m5stack EuroMillions APP help
Hello.
I'm desenvolving an APP for EuroMillions Lottery in my m5stack and I have some troubles with it and I hope someone will help me.
I sort n times a number between 1 and 50 (the Euromillions Lottery range of numbers). Every time a number is sorted, an array with 50 elements is incremented at the number sorted position. If 5 is sorted, then MatrixNumber[5]=MatrixNumber[5]+1. After n times I will seek the MatrixNumber[] and search for the biggest number there and the corresponding position where I found it and save the position in another array (FinalNumber[]). After that I zeroe the position so that it only be only one maximum values for all the array. (are you lost? I hope not). After all is done I get an array with 5 numbers (the most sorted by function "random(50)+1". I do the ssame stuff for the "Stars" part of the sorting.
Problem ONE: I can't SORT the array from lesser to bigger. I've done everything and it just don't sort.
Problem TWO: In "option" I use a number that can be "2" to "+2". That number will be added the the "sorted number" comparing his value. For example, variable "Option1" value will be added if a number is sorted between 1 and 6 and "Option2" value will be added to numkber sorted if the number is between 7 and 12, ... and so on (1..6,7..12,13..18,... are the lines on the lottery form). If I change the number to any row (row 1 to 8) beside value "00", the sorting is giving me almost always the same numbers. If I put the rows to position value of "00" then it's random again.
Very weird.
I copied the source code in pastebin because it's kind of big and I want to share the code anyway (but not with weird stuff on it).
https://pastebin.com/LBpKVPcv
Can anyone help?