Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pick 3 Lotto Code?
#1
I'm trying to make a Pick 3 lotto
in Python. Show me some example codes.

Ball 1:
0x Hit 1,8,9
1x Hit 2,3,4,7
2x Hit 0,5,6

Ball 2:
0x Hit 5,9
1x Hit 0,2,4,6,8
2x Hit 1,3

Ball 3:
0x Hit 0,2,9
1x Hit 4,6,7,8
2x Hit 1,3,5
Reply
#2
What have you done so far?
Reply
#3
# My example Pick 3
void randomfunc(int chkodds)
{
if (chkodds == 1) goto checkodds;
if (chkodds == 2) : odds = 1
if (chkodds == 3) : odds = 100
if (chkodds == 4) : odds = 1

checkodds:
## check odds of winning
chk_odds=random.randint(*4)

## odds of winning
odds=random.randint(*3)
void randomfunc(int odds)
{
if (odds == 1) goto checkodds
IF (odds == 100) goto checkodds
IF (odds == 1000) goto checkball

checkball:
num=random.randint(*4)
IF (num == 0) goto checkodds
IF (num == 1) goto ball1
IF (num == 2) goto ball2
IF (num == 3) goto ball3

ball1:
lroller=random.randint(*3)
IF (lroller == 0) : a = [1]
IF (lroller == 1) : a = [8]
IF (lroller == 2) : a = [9]
xroller=random.randint(*4)
IF (xroller == 0) : a = [2]
IF (xroller == 1) : a = [3]
IF (xroller == 2) : a = [4]
IF (xroller == 3) : a = [7]

yroller=random.randint(*3)
IF (yroller == 0): a = [0]
IF (yroller == 1): a = [5]
IF (yroller == 2): a = [6]
print ('a')

import os
os.system("pause")

GOTO checkodds
}
Reply
#4
Please post all code, output and errors between the appropriate code tags. Refer to the Help / Rules document on BBCode on how to properly post code. When Larz60+ asked you what you have tried, he means, what have you tried in Python. This is, after all, a Python forum.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#5
(Aug-28-2017, 11:28 AM)Python3 Wrote:
# My example Pick 3
void randomfunc(int chkodds) {
    if (chkodds == 1) goto checkodds;


That's not python.  We're not going to translate it for you, lol
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How do I pick the right python in Linux env? MDRI 9 3,687 Jun-27-2020, 05:40 PM
Last Post: snippsat
  Python MySQL - How to pick column row data as variable? bharaths 1 4,250 Nov-02-2018, 12:08 PM
Last Post: bharaths
  Pick Value from Json dataonmyview 3 3,019 Sep-24-2018, 04:11 PM
Last Post: nilamo
  BaseHTTPServer.HTTPServer pick-a-port? degenaro 1 2,500 Jul-05-2018, 08:36 PM
Last Post: gontajones

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020