your robot gives you the lottery number (python language)

Description

Here is a python script, which will give you the lottery numbers to play.

Related Hardware
EZ-Robot EZ-B v4
(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:

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.

PRO
Portugal
#1  
Nice. You have a inmoov?
PRO
Synthiam
#3  
Wow how big is the big one? Or how small is the small one lol. Can’t tell by the photos but that’s real great!
#4   — Edited
hello, the small 1m13 and the big 1m80 .

My new project to replace the arduino with EZ-BV4, to make the little inmoov more autonomous.
PRO
USA
#5  
can you translate that code into English?
PRO
USA
#6  
What scale did you print the small guy at?
#8  
Hello EzAng

i don't speak english, i use google translate.
To translate the sentences into English, just translate the sentences between quotes
as well as the comments.

example :
# recherche doublon. ==> 
# duplicate search

Audio.Say("Voci les numéros a jouer au loto .")==> Audio.Say ("Here are the numbers to play the lotto.")
PRO
USA
#9  
Bonjour,
J'ai des difficultés à naviguer sur votre site. Pouvez-vous indiquer où se trouve votre section de téléchargement?
Merci
PRO
USA
#11  
Bonjour,
J'ai des problèmes avec la compréhension des répertoires avec les fichiers dus à des problèmes de langue.
Avez-vous combiné des pièces pour l'impression puisque vous pourriez, par exemple, imprimer le torse complet à la fois avec une imprimante Crealty idf toutes les pièces ont été combinées
#12  
hello Perry ,
yes some parts are merged. I have a 20 x 20 x 20 printer.
Not all parts are present. you have to download them from Gael's site and reduce them to 0.64. If you have a bigger printer you can of course merge several pieces
PRO
USA
#13  
InMoov06,
I would like to thank you for posting here. Your mini-moov really got me thinking about building a smaller guy and I am having a blast. I am combining as many part as I can in CAD before painting. IT is so much more managible than my big Inmoov. It is so much cheaper to build. All inmoov's should be built to this size.
I have had to make design adjustments to make standard servos fit.
You can really do a lot of actuator work on it as well because the size is smaller as are the forces involved are much smaller. I'm excited again.


Perry
PRO
USA
#14   — Edited
Hi Perry, do you have the stl files for a small  InMoov to print?
PRO
USA
#15  
Hi EZAng,
I started with the standard Inmoov files off Gael's site. For single prints I just scale them to 64%. I use Solidworks to combine and redesign other pieces. When I am done I will post them up on Thingiverse probably. 
Here's the little guy after about a week of printing.

User-inserted image
#16  
hello perry
I modified the head to integrate the camera. the stl file is on my siteUser-inserted image

little finished inmoov

User-inserted image
PRO
USA
#17  
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 génial. Je pense que ce que vous avez fait est vraiment innovant pour la plateforme Inmoov. J'ai travaillé si dur sur ma taille réelle. Il a fallu plus d'un an pour construire et tout le coût du filament et des pièces était si élevé. Celui-ci prendra quelques mois et les servos sont plus petits et moins chers.
Je ne prévois pas d'utiliser la tête inmoov et j'ai des modifications spéciales en magasin. Je vais commencer mon propre fil pour ne pas détourner le vôtre.

De plus, je n'utilise pas vos pièces. J'apprécie vraiment la partie design, donc je crée la mienne mais peut-être qu'EZAng d'en haut serait intéressé par eux.

Merci encore,
Perry