Description
Here is a python script, which will give you the lottery numbers to play.
Related Hardware
EZ-B v4
Related Robot Skills
(python language)
The program is planned for a draw of 5 numbers and a lucky number. (French lottery). You will need to change the lottery program in your country.
here is the python code:
import random
def loto():
table1 = [(random.randint(1,49)), (random.randint(1,49)), (random.randint(1,49)), (random.randint(1,49)),(random.randint(1,49))]
tablefin = []
doublon = []
for i in table1:
if i not in tablefin:
tablefin.append(i) #supprime les doublons
else:
doublon.append(i) #extraire les doublons
d = len(doublon)
while d > 0:
#nouveau tirage
doublon = []
table1 = [(random.randint(1,49)), (random.randint(1,49)), (random.randint(1,49)), (random.randint(1,49)),(random.randint(1,49))]
# recherche doublon
for i in table1:
if i not in tablefin:
tablefin.append(i) #supprime les doublons
else:
doublon.append(i) #extraire les doublons
# si il existe doublon d+1 et vide la table
if (len(doublon)==1)or(len(doublon)==2)or(len(doublon)==3)or(len(doublon)==4)or(len(doublon)==5):
talkBlocking("j ai trouver un doublon , je refais un tirage")
d = d+1
doublon =[]
else:
d = 0
break
# tri la table avant de la dire
table1.sort()
Audio.Say("Voci les numéros a jouer au loto .")
Audio.Say("le "+str(table1[0]))
Audio.Say("le "+str(table1[1]))
Audio.Say("le "+str(table1[2]))
Audio.Say("le "+str(table1[3]))
Audio.Say("le "+str(table1[4]))
Audio.Say("Et le numéro chance le, "+str(random.randint(1,9)))
Audio.Say("Je vous souhaite bonne chance, ")
loto()
you will need to translate the sentences into the language of your country:
example: Audio.Say ("Here are the numbers to play the lotto.")
if you won, think of me, thank you ...
note : To make the EZROBOT micro-controller speak, replace Audio.Say by Audio.SayEZB . If you are interested in pthon programs, I can give you more here.

Wow, that looks great. I think what you have done is truly innovative for the Inmoov platform. I worked so hard on my full size one. It took over a year to build and all the filament and parts cost was so high. This one will take a couple of months and the servos are smaller and cheaper. I do not plan to use the inmoov head and have some special changes in store. I will start my own thread so I do not hijack yours.
Also, I am not using your parts. I really enjoy the design part so I am making my own but perhaps EZAng from above would be interested in them.
Thanks again, Perry
Wow, ça a l'air genial. Je pense que ce que vous avez fait est vraiment innovant pour la plateforme Inmoov. J'ai travaille si dur sur ma taille reelle. Il a fallu plus d'un an pour construire et tout le coût du filament et des pièces etait si eleve. Celui-ci prendra quelques mois et les servos sont plus petits et moins chers. Je ne prevois pas d'utiliser la tête inmoov et j'ai des modifications speciales en magasin. Je vais commencer mon propre fil pour ne pas detourner le vôtre.
De plus, je n'utilise pas vos pièces. J'apprecie vraiment la partie design, donc je cree la mienne mais peut-être qu'EZAng d'en haut serait interesse par eux.
Merci encore, Perry