![]() |
Project - UK & EU Lottery killas / Open Source donation builders - Printable Version +- Linux Lite Forums (https://www.linuxliteos.com/forums) +-- Forum: Development (https://www.linuxliteos.com/forums/forumdisplay.php?fid=7) +--- Forum: Coding (https://www.linuxliteos.com/forums/forumdisplay.php?fid=33) +--- Thread: Project - UK & EU Lottery killas / Open Source donation builders (/showthread.php?tid=5259) |
Project - UK & EU Lottery killas / Open Source donation builders - bitsnpcs - 05-18-2018 removed friendliness, it is off topic here Admin says. ![]() UK lottery random number picker, showing the Python code, and the successful running of this in Linux Lite Terminal. Here is the code - Code: from random import * Copy/paste this into a leafpad file in your Home Directory and name this file lot.py To run the file do - Hold down Ctrl + Alt and press t (Ctrl+Alt+t) Copy/paste or type in to your terminal Code: python lot.py The output will be of the form shown in the above screenshot, that is 6 numbers randomly picked from the 59 as you would do on a lottery ticket in UK. Then choose your options in real life (interactive) EU Lottery picker - ![]() EU lottery screenshot, showing Python code and the successful running of this in Linux Lite terminal. This will pick from the 50 numbers your 5 numbers. It will also pick from the 12 numbers your 2 lucky star numbers. It will also output text with lifestyle options (interactivity) Here is the code - Code: from random import * Copy/paste this into a leafpad file in your Home Directory and name this file eulot.py To run the file do - Hold down Ctrl + Alt and press t (Ctrl+Alt+t) Copy/paste or type in to your terminal Code: python eulot.py I hope it was interesting to read. Re: Project - UK & EU Lottery killas / Open Source donation builders - bitsnpcs - 05-18-2018 remove not on topic to offer assistance in this thread. Re: Project - UK & EU Lottery killas / Open Source donation builders - Mart - 05-18-2018 bitsnpcs Hope you don't mind but I managed to adapt your code to the UK Lotto game. It worked great. Here's the adapted code: Code: from random import * This was great fun and my first attempt at coding. So, thanks a lot. Or should I say - Thanks a million! Mart UPDATE: For all those familiar with the UK Lotto game, did you spot the output mistake - the bonus number is not chosen by the game player but provides a winning combination/tier just below the jackpot prize. So ignore the generated bonus number and just play the first six generated numbers. Can bitsnpcs or someone else come up with an improved code? Re: Project - UK & EU Lottery killas / Open Source donation builders - bitsnpcs - 05-18-2018 (05-18-2018, 06:20 PM)Mart link Wrote: bitsnpcs Yes the first code I posted lol , this is for the UK lotto and only picks the 6 numbers like the player needs to pick. It doesn't pick a bonus number as the player doesn't pick this. Edit - removed things not on topic Re: Project - UK & EU Lottery killas / Open Source donation builders - Mart - 05-18-2018 Hi bitsnpcs Thank you for the reply. Yes, in my enthusiasm I missed the most important bit about donating your stake or some future winnings to your favorite cause or project. Very inspiring. You're obviously using the Spirit code not just the python code. All the best to a fellow traveller. Mart Re: Project - UK & EU Lottery killas / Open Source donation builders - bitsnpcs - 05-18-2018 (05-18-2018, 06:20 PM)Mart link Wrote: Can bitsnpcs or someone else come up with an improved code? For picking one number in the range 1 thru 59 do Code: import random Save code to leafpad, with your chosen filename then run in terminal by Code: python filename.py <snip> removed things below here not on topic Re: Project - UK & EU Lottery killas / Open Source donation builders - bitsnpcs - 05-18-2018 removed not on the topic Re: Project - UK & EU Lottery killas / Open Source donation builders - Mart - 05-18-2018 I'm glad you like the phrase - I'm a bit of a frustrated writer with a few scripts knocking about, but stories on a human scale are not trending at the moment. Yes, I do find your efforts at trying to solve the coding problem interesting, but a little over my head for now. But i will re-read your explanation to try to get a better understanding of it myself. As they say, 'Fortune favors the prepared mind' so keep working on your solution. All the best Re: Project - UK & EU Lottery killas / Open Source donation builders - bitsnpcs - 05-18-2018 removed not on topic, not to be aiding hijacking of my thread. Re: Project - UK & EU Lottery killas / Open Source donation builders - Mart - 05-19-2018 Hi bitsnpcs The simplest way for me to explain what I meant by 'stories on a human scale' is to illustrate it with the following link of top box office Hollywood films by decade - http://www.filmsite.org/boxoffice2.html Just compare the 2000 and 2010 decades to the rest. You'll see that the most watched films of recent decades are mainly comic book and CGI created, obviously not possible until the digital age, but personally, in this respect, I'm a bit of an analogue type of guy, so to speak. There's nothing wrong with comic book and CGI inspired films of course, I have enjoyed some of the earlier ones myself, but now this genre tends to dominate the field. In contrast, I believe - Variety is the spice of life Perhaps we should start a members' 'favorite film' thread, like the music thread, but using film trailers. |