Prediction Game

Download as pdf or txt
Download as pdf or txt
You are on page 1of 68

A Mini Project report submitted on

FANTASY LEAGUE

in Partial fulfillment of the requirement for the award of the Degree of

BACHELOR OF TECHNOLOGY

IN

COMPUTER SCIENCE AND ENGINEERING


SUBMITTED
BY
K.SAI NITHIN
20671A0516

Under the esteemed guidance of


Mr. A. RAMESH BABU
ASSOCIATE PROFESSOR

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

J.B. INSTITUTE OF ENGINEERING & TECHNOLOGY


UGC AUTONOMOUS

(Accredited by NAAC & NBA, Approved by AICTE & Permanently affiliated by JNTUH) Yenkapally,
Moinabad mandal, R.R. Dist-75 (TG)

2023-2024

i
J.B.INSTITUTE OF ENGINEERING & TECHNOLOGY
UGC AUTONOMOUS

(Accredited by NAAC & NBA, Approved by AICTE & Permanently affiliated by JNTUH) Yenkapally,
Moinabad mandal, R.R. Dist-75 (TG)

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

CERTIFICATE

This is to certify that the Mini Project report entitled “ FANTASY LEAGUEOF ” submitted to
the Department of Computer Science and Engineering, J.B Institute of Engineering &
Technology, in accordance with Jawaharlal Nehru Technological University regulations as
partial fulfillment required for successful completion of Bachelor of Technology is a record of
bonafide work carried out during the academic year 2023-24 by K.SAI NITHIN
20671A0516

Internal Guide Head of the Department

MR.A.RAMESH BABU MR.G. SREENIVASULU

ASSOCIATE PROFESSOR ASSOCIATE PROFESSOR

ii
J.B.INSTITUTE OF ENGINEERING & TECHNOLOGY
UGC AUTONOMOUS

(Accredited by NAAC & NBA, Approved by AICTE & Permanently affiliated by JNTUH) Yenkapally,
Moinabad mandal, R.R. Dist-75 (TG)

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

DECLARATION

I hereby declared that the Mini Project report entitled “ FANTASY LEAGUEOF ” carried out
under the guidance of, Mr.A.RAMESH BABU, Associate Professor is submitted in partial
fulfillment of the requirements for the award of the degree of Bachelor of Technology in
Computer Science and Engineering. This is a record of bonafide work carried out by me and
the results embodied in this project report have not been reproduced or copied from any source.
The results embodied in this project report have not been submitted to any other university or
institute for the award of any other degree or diploma.

Date: 10 /12 / 2023


K.SAI NITHIN
20671A0516

iii
ACKNOWLEDGEMENT

At outset I express our gratitude to the almighty lord for showering his grace and blessings
upon us to complete this Mini Project. Although our name appears on the cover of this book,
many people have contributed in some form or the other to this project Development. I could
not have done this Project without the assistance or support of each of the following.

First of all I am highly indebted to Dr. P. C. KRISHNAMACHARY, Principal for giving me


the permission to carry out this Mini Project.

I would like to thank Mr. G. SREENIVASULU, Associate Professor & Head of the
Department of COMPUTER SCIENCE AND ENGINEERING, for being moral support
throughout the period of the study in the Department.

I am grateful to Mr. A. RAMESH BABU, Associate Professor COMPUTER SCIENCE


ENGINEERING, for his valuable suggestions and guidance given by him during the
execution ofthis Project work.

I would like to thank the Teaching and Non-Teaching Staff of the Department of Computer
Science & Engineering for sharing their knowledge with me.

K.SAI NITHIN

20671A0516

iv
TABLE OF CONTENTS

1. INTRODUCTION 01

2. LITERATURE SURVEY 02

3. 3. SYSTEM ANALYSIS 03-5

3.1 Existing Systems 03

3.1.1 Disadvantages 03

3.2 Proposed Systems 04

3.2.1 Advantages 04

3.3 Functional Requirements 04

3.4 Non-Functional Requirements 04

3.5 Hardware Requirements 05

3.6 Software Requirements 05

4. SYSTEM DESIGN 06-14

4.1 Design 06-10

4.2 Python 10-14

5. IMPLEMENTATION 15-49

5.1 Testing 15

5.2 Source Code 15-49

6. TESTING 32

6.1 Testing Methodologies 32

6.2 Test Cases 32

7. OUTPUT SCREENS 50-56

v
8. CONCLUSION 57

9. FUTURE ENHANCEMENTS 58

10. BIBLIOGRAPHY 59

vi
ABSTRACT
This is a prediction game guided with Graphical User Interface. This can be used/played by
anyone who has basic cricket knowledge. The user must register himself and verify himself with
his g-mail account. The user will be given 500 points for registering himself. The user should
select the available matches. The user should invest his point so n the options given. The user has
freedom to invest this money on both the options for the given question .If his options are correct
then his points will be doubled otherwise his invested points on the question will be halved. The
project has an admin login through which the admin sets the match between the teams competing
and feeds the answer for the question after the match has completed. The leader board positions
will be shown with all the registered users irrespective of the participation. The questions are
quite simple, like more run getters, more wickets etc., among the players shown as options. This
project is developed to provide fun of betting without investing a penny. We came across this
project looking at various advertisements during the Indian premier league. For doing this project,
we gained some basic knowledge about GUI programming in python. The package tkinter is
used in this project, it will provide the required GUI.

vii
LIST OF FIGURES

SL.NO NAME OF THE FIGURE PAGE NO

4.1 BLOCK DIAGRAM OF ARCHITECTURE 06

4.1 ACTIVITY DIAGRAM 10

7.1 LOGGING IN AS ADMIN BY EXECUTING 50

AS ADMIN.PY

7.2 HOME PAGE FOR ADMIN EXECUTING 50

MATCH SETUP.PY

7.3 SETTING A MATCH USING PREMATCH.PY 51

BETWEEN INDIAAND PAKISTAN

7.4 SETTING THE OPTIONS FOR QUESTIONAL USING 51

QUESTIONAL.PY

7.5 SETTING THE OPTIONS FOR QUESTIONAL USING 52

QUESTIONAL.PY

7.6 SETTING THR OPTIONS FOR QUESTION2 USING 52

QUESTION2.PY

7.7 SETTING THE OPTIONS FOR QUESTION3 USING 53

QUESTION3.PY

7.8 SETTING THE OPTIONS FOR QUESTION4 USING 53

QUESTION4.PY

7.9 LOGIN AND ANSWER THE QUESTION SET UP NOW 53

viii
7.10 CREATE USER AND PASSWORD 54

7.11 HOME PADE FOR LEADERBOARD 54

7.12 LEADERBOARD USING LEADERBOARD1.PY AND 55

LEADERBOARD.PY

7.13 BET IN THE MATCH USING BET.PY 55

7.14 TWO MATCHES ARE AVALIABLE SO SELECT 56

ONE AMAONG THEM AS

7.15 THE ADMIN CAN EVEN ADD POINTS TO ALLTHE 56

USER USING BONUS BY ADD.PY

7.16 UPLOADED LEADERBOARD 56

ix
1. INTRODUCTION
Fantasy league is a kind of a cricket betting game. It is a very simple game and can be played
by any one having very basic cricket knowledge. The game has many test cases associated
with it and neat description of each test case is provided in the report. First of all, the user
must register/ sign up first. Then, he can login with the password set by him earlier. Then he
has got several options after logging in. He may go on and bet, if any matches are available
or else, he may check the leader board positions of different users and compare himself with
the other users.If ever any matches are available and the user is eligible (that is if the user has
a total of coins more than 400), then the user need to enter the name of the teams between
whom the match is scheduled, without any separation/gap. Then the window will direct to a
new window where the user must invest his coins on the players given for that particular
question. While answering the question, the user must invest the coins on both the players in
the match such that the total amount invested on both the players will be a sum of 100. If
ever the user has no interest on the teams scheduled for the match, then he can avoid his
participation in the match. The user points will not be affected if ever he does not participate
in a particular match. The user can change his investment at any time until the admin locks
the permission to overwrite. The user may overwrite by again through the login procedure
and selecting the match. The match will be visible until the admin locks it. The answer
validation after the match will be done on the latest entries of the user. The matches are setup
by the admin using admin login and pass key of the admin. Before the match, the admin can
set up the match between two different teams. He gives the options of different questions
with different players on both the sides or between the players from the same sides. Once the
admin sets up the match between two teams, the next moment it will be visible on the user’s
screen that match has been set between some teams and can be answerable by the users. After
the completion of match, the admin will declare the answers for the questions. The coins
invested by the user will be saved initially which will be matched by the correct answer. The
coins invested on the correct option will be doubled and the coins invested on wrong option
will be halved, and the resultant amount will be added to the user’s total. The leader board
will be updated with the respective user totals.

1
2. LITERATURE SURVEY

Fantasy sport, to take a general definition, ‘involves a group of people who choose a set of
individual athletes for a fantasy team from a given sport, aggregate the statistical
performances of these athletes, and then compete with one another to see whose team
generates the highest point totals’ (Baerg, 2009, “Defining and Describing Fantasy Sports,”
para. 1). Accounts of its evolution vary: some trace it back to early board games, such as
those manufactured by APBA and Strat-O-Matic in the 1950s and 1960s, while others trace it
back to the baseball game that Harvard professor William Gamson developed and played
with colleagues in the early 1960s. All, however, highlight the role played by Dan Okrent, a
prominent writer and editor, in codifying and disseminating fantasy baseball, through his
rotisserie league, in the early 1980s.
To date, two academic review articles have been published on fantasy sport. In the first,
Baerg (2009) surveyed the nascent literature from a communication perspective, describing
fantasy sport and its history, examining the few published studies and presenting potential
directions for future research.
In the second, Hill and Woo (2011), also from a communication perspective, reviewed the
(now slightly larger) literature and interviewed industry experts. Together, these reviews
cover important ground. In particular, they identify some interesting possibilities for future
research – possibilities we re-examine in our concluding discussion. However, neither aimed
for systematic, comprehensive coverage of the fantasy sport literature within pre-specified
boundaries, which is what we seek to do here. Nor did either of them seek systematically to
evaluate the research approaches of the articles they examined. Moreover, as our subsequent
analysis shows, the bulk of fantasy sport research post-dates these earlier reviews.
Research synthesis, in one form or another, is part of nearly every research project. However,
‘in recent years in a number of disciplines across the social sciences, interest in research
synthesis as a primary research activity has grown’ (Weed, 2005, p. 77, emphasis added).
This interest has developed, in part, from recognition that many areas of social science were
not utilising past research effectively. Here, we undertake a systematic review, which, unlike
more traditional (narrative) reviews, aims for comprehensive coverage of a particular area
within pre-specified boundaries (Klassen, Jahad, & Moher, 1998).

2
3.SYSTEM ANALYSIS

3.1 EXISTING SYSTEM


The existing system is a prediction game for cricket enthusiasts that uses a Graphical User
Interface (GUI).Users are required to register and verify their identity with a Gmail account.
Upon registration, users are given 500 points. Users can select available cricket matches and
invest their points on various prediction options. If their predictions are correct, they double their
points otherwise, the invested points are halved. Admins are responsible for setting up matches
and providing correct answers after the match. The system displays a leader board with the
positions of all registered users.

3.1.1 DISADVANTAGES
 Dependency on Gmail account: Requiring users to verify themselves with a gmail account
can be a limitation, as not all potential users may have gmail accounts
 Limited game variety: The game seems to have limited options, mainly Focusing on simple
cricket predictions (e.g., top run-getters, most wickets). This may not cater to a broad
audience.
 Risk of gambling Mentality: While it claims to offer the fun of betting without real money,
the system may inadvertently encourage a gambling mentality among users.
 Lack of Real-Time data: The system relies on admin-provided answers after matches, which
means cannot see real-time results. This might decreses user enagagement.

3.2 PROPOSED SYSTEM


 Dependency on Gmail account: Requiring users to verify themselves with a gmail account
can be a limitation, as not all potential users may have gmail accounts
 Limited game variety: The game seems to have limited options, mainly Focusing on simple
cricket predictions (e.g., top run-getters, most wickets). This may not cater to a broad
audience.
 Risk of gambling Mentality: While it claims to offer the fun of betting without real money,
the system may inadvertently encourage a gambling mentality among users.

3
 Lack of Real-Time data: The system relies on admin-provided answers after matches, which
means cannot see real-time results. This might decreses user enagagement.

3.2.1 ADVANTAGES

 Enhanced User Inclusivity: Allowing multiple authentication methods makes the system
accessible to a broader user base.
 Greater Engagement: Diversifying game options and real-time data can increase user
engagement and excitement.
 Reduced Admin Workload: Automation reduces the workload on admins, making the
system more efficient and accurate.
 Improved Responsible Gaming: Implementing features for responsible gaming can
create a safer and more enjoyable user experience.
 Better User Insights: With an enhanced leaderboard, users can gain insights into their
performance, fostering healthy competition and motivation to participate more activel

3.3 FUNCTIONAL REQUIREMENTS


 User Registarion

 League Creation

 Team Creaction

 Scoring System

 Transfer System

 Leaderboard

 Notification

3.4 NON FUNCTIONAL REQUIREMENTS

 Performance

 Reliability

 Security

4
 Compatibility

 Regulatory Compliance

3.5 HARDWARE REQUIRMENTS


 System : Intel Core i5.
 Hard Disk : 120 GB.
 Monitor : 15’’ LED
 Input Devices : Keyboard, Mouse
 Ram : 2 GB

3.6 SOFTWARE REQUIREMENTS

 Operating system : Windows 7.


 Coding Language : Python
 Tool : Python Interpreter

5
4. SYSTEM DESIGN

4.1 DESIGN

Fig:4.1.1: Block Diagram of Architecture

Use Case ID: UC01


Name: Registering
Actors: Player
Description: Allows the user to register himself.
Pre-conditions: None
Post-conditions: Account will be created for the user.
Main Flow:

6
Name: Login
Actors: Player
Description: Allows the user to login into his account.
Pre-conditions: The player must have a registered account.
Post-conditions: The user logs in.
Main Flow:

Use Case ID: UC03


Name: Leader Board
Actors: Player and Admin
Description: Allows the actor to view the leaderboard positions
Pre-conditions: The actor player must login
Post-conditions: The leader board is displayed
Main Flow:

7
Use Case ID: UC04
Name: Match Bet
Actors: Player
Description: Checks for match availability and displays the matches
Pre-conditions: The player must login
Post-conditions: The matches will be displayed onto the screen
Main Flow:

Use Case ID: UC05


Name: Questions
Actors: Player
Description: Allows the player to invest his coins on the respective options
Pre-conditions: The matches must be available.
Post-conditions: The investment amount will be saved.
Main Flow:

8
Use Case ID: UC06
Name: Match Setup
Actors: Admin
Description: Allows the admin to set the match.
Pre-conditions: None
Post-conditions: The match will be set up by the admin.
Main Flow:

Use Case ID: UC07


Name: Results
Actors: Admin
Description: The result of the match will be published by feeding the correct options.
Pre-conditions: There must be a match for which the results are not declared yet.
Post-conditions: The results will be declared and the leaderboard will be updated.
Main Flow:

9
4.1.2 ACTIVITY DIAGRAM

What is Python?
Below are some facts about Python.
 Python is currently the most widely used multi-purpose, high-level programming
language.
 Python allows programming in Object-Oriented and Procedural paradigms. Python
programs generally are smaller than other programming languages like Java.
 Programmers have to type relatively less and indentation requirement of the language,
makes them readable all the time.
 Python language is being used by almost all tech-giant companies like – Google,
Amazon, Facebook, Instagram, Dropbox, Uber… etc.

10
The biggest strength of Python is huge collection of standard library which can be used for
the following –
 Machine Learning
 GUI Applications (like Kivy, Tkinter, PyQt etc. )
 Web frameworks like Django (used by YouTube, Instagram, Dropbox)
 Image processing (like Opencv, Pillow)
 Web scraping (like Scrapy, BeautifulSoup, Selenium)
 Test frameworks
 Multimedia

Advantages of Python
Let’s see how Python dominates over other languages.
1. Extensive Libraries
Python downloads with an extensive library and it contain code for various purposes like
regular expressions, documentation-generation, unit-testing, web browsers, threading,
databases, CGI, email, image manipulation, and more. So, we don’t have to write the
complete code for that manually.
2. Extensible
As we have seen earlier, Python can be extended to other languages. You can write some of
your code in languages like C++ or C. This comes in handy, especially in projects.
3. Embeddable
Complimentary to extensibility, Python is embeddable as well. You can put your Python code
in your source code of a different language, like C++. This lets us add scripting capabilities
to our code in the other language.
4. Improved Productivity
The language’s simplicity and extensive libraries render programmers more productive than
languages like Java and C++ do. Also, the fact that you need to write less and get more things
done.
5. IOT Opportunities
Since Python forms the basis of new platforms like Raspberry Pi, it finds the future bright for
the Internet Of Things. This is a way to connect the language with the real world.

11
6. Simple and Easy
When working with Java, you may have to create a class to print ‘Hello World’. But in
Python, just a print statement will do. It is also quite easy to learn, understand, and code. This
is why when people pick up Python, they have a hard time adjusting to other more verbose
languages like Java.
7. Readable
Because it is not such a verbose language, reading Python is much like reading English. This
is the reason why it is so easy to learn, understand, and code. It also does not need curly
braces to define blocks, and indentation is mandatory. This further aids the readability of the
code.
8. Object-Oriented
This language supports both the procedural and object-oriented programming paradigms.
While functions help us with code reusability, classes and objects let us model the real world.
A class allows the encapsulation of data and functions into one.
9. Free and Open-Source
Like we said earlier, Python is freely available. But not only can you download Python for
free, but you can also download its source code, make changes to it, and even distribute it. It
downloads with an extensive collection of libraries to help you with your tasks.
10. Portable
When you code your project in a language like C++, you may need to make some changes to
it if you want to run it on another platform. But it isn’t the same with Python. Here, you need
to code only once, and you can run it anywhere. This is called Write Once Run Anywhere
(WORA). However, you need to be careful enough not to include any system-dependent
features.
11. Interpreted
Lastly, we will say that it is an interpreted language. Since statements are executed one by
one, debugging is easier than in compiled languages.
Any doubts till now in the advantages of Python? Mention in the comment section.

12
Advantages of Python Over Other Languages
1. Less Coding
Almost all of the tasks done in Python requires less coding when the same task is done in
other languages. Python also has an awesome standard library support, so you don’t have to
search for any third-party libraries to get your job done. This is the reason that many people
suggest learning Python to beginners.
2. Affordable
Python is free therefore individuals, small companies or big organizations can leverage the
free available resources to build applications. Python is popular and widely used so it gives
you better community support.
The 2019 Github annual survey showed us that Python has overtaken Java in the most
popular programming language category.
3. Python is for Everyone
Python code can run on any machine whether it is Linux, Mac or Windows. Programmers
need to learn different languages for different jobs but with Python, you can professionally
build web apps, perform data analysis and machine learning, automate things, do web
scraping and also build games and powerful visualizations. It is an all-rounder programming
language.

Disadvantages of Python
So far, we’ve seen why Python is a great choice for your project. But if you choose it, you
should be aware of its consequences as well. Let’s now see the downsides of choosing
Python over another language.
1. Speed Limitations
We have seen that Python code is executed line by line. But since Python is interpreted, it
often results in slow execution. This, however, isn’t a problem unless speed is a focal point
for the project. In other words, unless high speed is a requirement, the benefits offered by
Python are enough to distract us from its speed limitations.
2. Weak in Mobile Computing and Browsers

13
While it serves as an excellent server-side language, Python is much rarely seen on the client-
side. Besides that, it is rarely ever used to implement smartphone-based applications. One
such application is called Carbonnelle.
The reason it is not so famous despite the existence of Brython is that it isn’t that secure.
3. Design Restrictions
As you know, Python is dynamically typed. This means that you don’t need to declare the
type of variable while writing the code. It uses duck-typing. But wait, what’s that? Well, it
just means that if it looks like a duck, it must be a duck. While this is easy on the
programmers during coding, it can raise run-time errors.
4. Underdeveloped Database Access Layers
Compared to more widely used technologies like JDBC (Java DataBase Connectivity) and
ODBC (Open DataBase Connectivity), Python’s database access layers are a bit
underdeveloped. Consequently, it is less often applied in huge enterprises.
5. Simple
No, we’re not kidding. Python’s simplicity can indeed be a problem. Take my example. I
don’t do Java, I’m more of a Python person. To me, its syntax is so simple that the verbosity
of Java code seems unnecessary.
This was all about the Advantages and Disadvantages of Python Programming Language.

14
5 . IMPLEMENTATION

5.1 Testing /Deployment

Opening screen of the application. You can see the players of each category by selecting the
category. To begin with, the selection is disabled until a new team is created from the Manage
Teams menu. A pop up asking the name of the team appears.
The toolbar menu options which allow you to create a new team, open an existing team, save
your team and finally evaluate the score of a saved team.After clicking New Team, the left box is
populated with player names.
As you select a different category, the corresponding list of players is displayed.On double-
clicking each player name, the right box gets populated. Points available and used are displayed
accordingly.
Message if the game logic is not followedUpon opening the second file to evaluate the scores.
You can select your team here and the match for which the players' performance is compared.
The final score for your fantasy team based on the match selected.

5.2 Source Code

import tkinter as r
import tkinter.font as tkfont
page2=r.Tk()
page2.title("Login")
page2.configure(bg='cyan')
page2.geometry('770x500')
labelsty=tkfont.Font(family="Lucida Grande",size=10)
labelsty.configure(size=100)
l=r.Label(page2,text='WELCOME',font=labelsty)
l.pack(side='top')
l.place()
l.configure(bg='cyan')
buttonsty=tkfont.Font(family="Lucida Grande",size=2)
buttonsty.configure(size=20)

15
def user():
page2.destroy()
import user
def admin():
page2.destroy()
import admin
button1=r.Button(page2,text='User login',command=user,font=buttonsty)
button2=r.Button(page2,text='Admin Login',command=admin,font=buttonsty)
#button1.pack(size='top')
button1.place(x=315,y=250)
button2.place(x=302,y=310)
page2.mainloop()

admin.py
import tkinter as r
import tkinter.font as tkfont
admin=r.Tk()
admin.title("Admin Login")
admin.configure(bg='cyan')
admin.geometry('770x500')
labelsty=tkfont.Font(family="Lucida Grande",size=10)
labelsty.configure(size=100)
l=r.Label(admin,font=labelsty,text='ADMIN')
l.pack(side='top')
l.place()
l.configure(bg='cyan')
1=tkfont.Font(family="Lucida Grande",size=10)
f1.configure(size=25)
f2=tkfont.Font(family='Lucida Grande',size=10)
f2.configure(size=20)
f3=tkfont.Font(family='Lucida Grande',size=10)
f3.configure(size=10)
l1=r.Label(admin,text='Enter the passkey',font=f1)

16
e1=r.Entry(admin,width=10,font=f1)
l1.place(x=150,y=250)
l1.configure(bg='cyan')
e1.place(x=410,y=250)
def launch():
passkey=e1.get()
if(passkey=='1409'):
admin.destroy()
import matchsetup
b1=r.Button(admin,text='Launch',font=f2,command=launch)
b1.place(x=350,y=357)
def back():
admin.destroy()
import page1
b2=r.Button(admin,text='Back',font=f3,command=back)
b2.place(x=15,y=450)
admin.mainloop()

user.py
import tkinter as r
import tkinter.font as tkfont
user=r.Tk()
user.title("User")
user.configure(bg='cyan')
user.geometry('770x500')
labelsty=tkfont.Font(family="Lucida Grande",size=10)
labelsty.configure(size=100)
l=r.Label(user,text='LOGIN',font=labelsty)
l.pack(side='top')
l.place()
l.configure(bg='cyan')
buttonsty=tkfont.Font(family="Lucida Grande",size=2)
buttonsty.configure(size=20)

17
def existing():
user.destroy()
import existingdemo
def new():
user.destroy()
import new
def back():
user.destroy()
import page1
f3=tkfont.Font(family="Lucida Grande",size=10)
f3.configure(size=10)
button1=r.Button(user,text='Existing user',command=existing,font=buttonsty)
button2=r.Button(user,text='New user',command=new,font=buttonsty)
button3=r.Button(user,text='Back',font=f3,command=back)
button1.place(x=302,y=250)
button2.place(x=325,y=310)
button3.place(x=15,y=450)
user.mainloop()

existingdemo.py
import tkinter as r
import tkinter.font as tkfont
existing=r.Tk()
existing.title("EXISTING USER")
existing.configure(bg='cyan')
existing.geometry('770x500')
labelsty=tkfont.Font(family="Lucida Grande",size=10)
labelsty.configure(size=100)
l=r.Label(existing,text='Login User',font=labelsty)
l.place(x=60)
l.configure(bg='cyan')
f1=tkfont.Font(family="Lucida Grande",size=10)
f1.configure(size=25)

18
l1=r.Label(existing,text='Enter the username',font=f1)
e1=r.Entry(existing,width=25,font=f1)
l2=r.Label(existing,text='Enter the password',font=f1)
e2=r.Entry(existing,width=25,font=f1)
l1.configure(bg='cyan')
l2.configure(bg='cyan')
l1.place(y=250)
e1.place(x=300,y=250)
l2.place(y=300)
e2.place(x=300,y=300)
f2=tkfont.Font(family='Lucida Grande',size=10)
f2.configure(size=20)
f3=tkfont.Font(family='Lucida Grande',size=10)
f3.configure(size=10)
def back():
existing.destroy()
import user
def login():
import openpyxl
wb=openpyxl.load_workbook("Project.xlsx")
sh1=wb['Sheet1']
user=[]
row=sh1.max_row
username=e1.get()
password=e2.get()
for i in range(2,row+1):
if(sh1.cell(i,1).value==username):
pos=i
print(pos)
print(sh1.cell(pos,2).value)
print(password)
if(int(sh1.cell(pos,2).value)==int(password)):

19
print("Success is not a destination.It's a journey")
f = open("user.txt",'w')
f.write(username)
f.write('\n')
f.write(str(pos))
f.close()
existing.destroy()
import home
else:
l3=r.Label(existing,text='Entered username and password are incorrect.')
l3.place(x=300,y=205)
b1=r.Button(existing,text='Login',font=f2,command=login)
b1.place(x=350,y=357)
b2=r.Button(existing,text='Back',font=f3,command=back)
b2.place(x=15,y=450)
existing.mainloop()

new.py
import tkinter as r
import tkinter.font as tkfont
new=r.Tk()
new.title("NEW USER")
new.configure(bg='cyan')
new.geometry('770x500')
labelsty=tkfont.Font(family="Lucida Grande",size=10)
labelsty.configure(size=100)
l=r.Label(new,text='New User',font=labelsty)
l.place(x=85)
l.configure(bg='cyan')
f1=tkfont.Font(family="Lucida Grande",size=10)
f1.configure(size=25)
l1=r.Label(new,text='Enter the username',font=f1)
e1=r.Entry(new,width=25,font=f1)

20
l2=r.Label(new,text="Enter the password",font=f1)
e2=r.Entry(new,width=25,font=f1)
l1.configure(bg='cyan')
l2.configure(bg='cyan')
l1.place(y=250)
e1.place(x=300,y=250)
l2.place(y=300)
e2.place(x=300,y=300)
f2=tkfont.Font(family="Lucida Grande",size=10)
f2.configure(size=20)
f3=tkfont.Font(family="Lucida Grande",size=10)
f3.configure(size=10)
def back():
new.destroy()
import user
def create():
import openpyxl
wb=openpyxl.load_workbook("Project.xlsx")
sh1=wb['Sheet1']
user_ids=[]
row=sh1.max_row
username=e1.get()
password=e2.get()
for i in range(2,row+1):
user_ids.append(sh1.cell(i,1).value)
#print(username)
#print(user_ids)
if username in user_ids:
l3=r.Label(new,text='Sorry! The username already exists',font=f3)
l3.place(x=300,y=205)
else:
sh1.cell(row=row+1,column=1,value=username)

21
sh1.cell(row=row+1,column=2,value=password)
sh1.cell(row=row+1,column=3,value=500)
wb.save('Project.xlsx')
new.destroy()
import existingdemo
b1=r.Button(new,text='Create',font=f2,command=create)
b1.place(x=350,y=357)
b2=r.Button(new,text='Back',font=f3,command=back)
b2.place(x=15,y=450)
new.mainloop()

prematch.py
import tkinter as r
import tkinter.font as tkfont
prematch=r.Tk()
prematch.title("Prematch setup")
prematch.configure(bg='cyan')
prematch.geometry('770x500')
labelsty=tkfont.Font(family="Lucida Grande",size=10)
labelsty.configure(size=40)
l=r.Label(prematch,font=labelsty,text='Select two teams')
l.pack(side='top')
l.place()
l.configure(bg='cyan')
f1=tkfont.Font(family="Lucida Grande",size=10)
f1.configure(size=15)
f2=tkfont.Font(family="Lucida Grande",size=10)
f2.configure(size=15)
f3=tkfont.Font(family='Lucida Grande',size=10)
f3.configure(size=10)
l1=r.Label(prematch,font=f1,text='First team')
l1.place(x=250,y=200)
l1.configure(bg='cyan')

22
e1=r.Entry(prematch,width=11,font=f1)
e1.place(x=377,y=200)
l2=r.Label(prematch,font=f1,text='Second team')
l2.place(x=250,y=250)
l2.configure(bg='cyan')
e2=r.Entry(prematch,width=11,font=f1)
e2.place(x=377,y=250)
def create():
first=e1.get()
second=e2.get()
if(first==second):
l3=r.Label(prematch,font=f1,text='The match cannot be setup between two same teams.')
l3.place(x=105,y=100)
l3.configure(bg='cyan')
else:
import openpyxl
wb=openpyxl.load_workbook("Project.xlsx")
sh1=wb['Sheet1']
c=sh1.max_column
name1=first+'%'+second+'1'
name2=first+'%'+second+'2'
name3=first+'%'+second+'3'
name4=first+'%'+second+'4'
name5=first+'%'+second+'5'
name6=first+'%'+second+'6'
name7=first+'%'+second+'7'
name8=first+'%'+second+'8'
sh1.cell(row=1,column=c+1,value=name1)
sh1.cell(row=1,column=c+2,value=name2)
sh1.cell(row=1,column=c+3,value=name3)
sh1.cell(row=1,column=c+4,value=name4)
sh1.cell(row=1,column=c+5,value=name5)

23
sh1.cell(row=1,column=c+6,value=name6)
sh1.cell(row=1,column=c+7,value=name7)
sh1.cell(row=1,column=c+8,value=name8)
sh1.cell(row=2,column=c+7,value="#")
sh1.cell(row=2,column=c+6,value="#")
sh1.cell(row=2,column=c+5,value="#")
sh1.cell(row=2,column=c+4,value="#")
sh1.cell(row=2,column=c+3,value="#")
sh1.cell(row=2,column=c+2,value="#")
sh1.cell(row=2,column=c+1,value="#")
sh1.cell(row=2,column=c+8,value="#")
wb.save('Project.xlsx')
prematch.destroy()
import question1
def back():
prematch.destroy()
import match
b2=r.Button(prematch,text='Back',font=f3,command=back)
b2.place(x=15,y=450)
b1=r.Button(prematch,text='Set',font=f2,command=create)
b1.place(x=350,y=300)

postmatch.py
f2=open("user.txt","w")
f2.write("adminmowa")
f2.write("\n")
f2.write("2")
f2.close()
import bet1

add.py
import tkinter as r
import tkinter.font as tkfont

24
bonus=r.Tk()
bonus.title("Bonus")
bonus.configure(bg='cyan')
bonus.geometry('770x500')
labelsty=tkfont.Font(family="Lucida Grande",size=10)
labelsty.configure(size=50)
l=r.Label(bonus,font=labelsty,text='MATCH')
l.pack(side='top')
l.place()
l.configure(bg='cyan')
f1=tkfont.Font(family="Lucida Grande",size=10)
f1.configure(size=25)
def enter():
add=e1.get()
import openpyxl
wb=openpyxl.load_workbook("Project.xlsx")
sh1=wb['Sheet1']
row=sh1.max_row
col=sh1.max_column
for i in range(3,row+1):
ans=sh1.cell(i,3).value
ans=ans+add
sh1.cell(row=i,column=3,value=ans)
wb.save("Project.xlsx")
bonus.destroy()
print("Program terminated successfully.")
l1=r.Label(bonus,font=f1,text='Enter the bonus amount')
l1.place(x=100,y=200)
l1.configure(bg='cyan')
e1=r.Entry(bonus,font=f1,width=10)
e1.place(x=455,y=200)
b1=r.Button(bonus,font=f1,text="Enter",command=enter)

25
b1.place(x=320,y=300)
f3=tkfont.Font(family='Lucida Grande',size=10)
f3.configure(size=10)
def back():
bonus.destroy()
import matchsetup
b2=r.Button(bonus,text='Back',font=f3,command=back)
b2.place(x=15,y=450)

question1.py
import tkinter as r
import tkinter.font as tkfont
question1=r.Tk()
question1.title("Question 1")
question1.configure(bg='cyan')
question1.geometry('770x500')
labelsty=tkfont.Font(family="Lucida Grande",size=10)
labelsty.configure(size=40)
l=r.Label(question1,font=labelsty,text='Question 1')
l.pack(side='top')
l.place()
l.configure(bg='cyan')
f1=tkfont.Font(family="Lucida Grande",size=10)
f1.configure(size=20)
f2=tkfont.Font(family="Lucida Grande",size=10)
f2.configure(size=15)
f3=tkfont.Font(family='Lucida Grande',size=10)
f3.configure(size=10)
l1=r.Label(question1,font=f1,text='Who will hit the more number of sixes')
l1.place(x=140,y=170)
l1.configure(bg='cyan')
e1=r.Entry(question1,font=f1,width=11)
e1.place(x=167,y=220)

26
e2=r.Entry(question1,font=f1,width=11)
e2.place(x=405,y=220)
def back():
question1.destroy()
import prematch
def nextq():
player1=e1.get()
player2=e2.get()
if(player1==player2):
l2=r.Label(question1,font=f3,text='Same player name cannot be given twice.')
l2.place(x=250,y=140)
l2.configure(bg='cyan')
else:
import openpyxl
wb=openpyxl.load_workbook("Project.xlsx")
sh1=wb['Sheet1']
c=sh1.max_column
name=sh1.cell(1,c-1).value
match=""
for i in name:
if(i=='%' or i=='1' or i=='2'):
pass
else:
match=match+i
match=match[:-1]
match=match+'.txt'
f = open(match,'w')
writeinto=['%','\n',player1,'\n','%','\n',player2,'\n']
f.writelines(writeinto)
f.close()
question1.destroy()
import question2

27
b2=r.Button(question1,text='Back',font=f3,command=back)
b2.place(x=15,y=450)
b1=r.Button(question1,text='Next',font=f2,command=nextq)
b1.place(x=343,y=270)

question2.py
import tkinter as r
import tkinter.font as tkfont
question2=r.Tk()
question2.title("Question 2")
question2.configure(bg='cyan')
question2.geometry('770x500')
labelsty=tkfont.Font(family="Lucida Grande",size=10)
labelsty.configure(size=40)
l=r.Label(question2,font=labelsty,text='Question 2')
l.pack(side='top')
l.place()
l.configure(bg='cyan')
f1=tkfont.Font(family="Lucida Grande",size=10)
f1.configure(size=20)
f2=tkfont.Font(family="Lucida Grande",size=10)
f2.configure(size=15)
f3=tkfont.Font(family='Lucida Grande',size=10)
f3.configure(size=10)
l1=r.Label(question2,font=f1,text='Who will take more number of catches')
l1.place(x=140,y=170)
l1.configure(bg='cyan')
e1=r.Entry(question2,font=f1,width=11)
e1.place(x=167,y=220)
e2=r.Entry(question2,font=f1,width=11)
e2.place(x=405,y=220)
def nextq():
player1=e1.get()

28
player2=e2.get()
if(player1==player2):
l2=r.Label(question2,font=f3,text='Same player name cannot be given twice.')
l2.place(x=250,y=140)
l2.configure(bg='cyan')
else:
import openpyxl
wb=openpyxl.load_workbook("Project.xlsx")
sh1=wb['Sheet1']
c=sh1.max_column
name=sh1.cell(1,c-1).value
match=""
for i in name:
if(i=='%' or i=='1' or i=='2'):
pass
else:
match=match+i
match=match[:-1]
match=match+'.txt'
f = open(match,'a+')
writeinto=['%','\n',player1,'\n','%','\n',player2,'\n']
f.writelines(writeinto)
f.close()
question2.destroy()
import question3
b1=r.Button(question2,text='Next',font=f2,command=nextq)
b1.place(x=343,y=270)

question3.py
import tkinter as r
import tkinter.font as tkfont
question3=r.Tk()
question3.title("Question 3")

29
question3.configure(bg='cyan')
question3.geometry('770x500')
labelsty=tkfont.Font(family="Lucida Grande",size=10)
labelsty.configure(size=40)
l=r.Label(question3,font=labelsty,text='Question 3')
l.pack(side='top')
l.place()
l.configure(bg='cyan')
f1=tkfont.Font(family="Lucida Grande",size=10)
f1.configure(size=20)
f2=tkfont.Font(family="Lucida Grande",size=10)
f2.configure(size=15)
f3=tkfont.Font(family='Lucida Grande',size=10)
f3.configure(size=10)

l1=r.Label(question3,font=f1,text='Who will have more strike rate')


l1.place(x=140,y=170)
l1.configure(bg='cyan')
e1=r.Entry(question3,font=f1,width=11)
e1.place(x=167,y=220)
e2=r.Entry(question3,font=f1,width=11)
e2.place(x=405,y=220)
def nextq():
player1=e1.get()
player2=e2.get()
if(player1==player2):
l2=r.Label(question3,font=f3,text='Same player name cannot be given twice.')
l2.place(x=250,y=140)
l2.configure(bg='cyan')
else:
import openpyxl
wb=openpyxl.load_workbook("Project.xlsx")

30
sh1=wb['Sheet1']
c=sh1.max_column
name=sh1.cell(1,c-1).value
match=""
for i in name:
if(i=='%' or i=='1' or i=='2'):
pass
else:
match=match+i
match=match[:-1]
match=match+'.txt'
f = open(match,'a')
writeinto=['%','\n',player1,'\n','%','\n',player2,'\n']
f.writelines(writeinto)
f.close()
question3.destroy()
import question4
b1=r.Button(question3,text='Next',font=f2,command=nextq)
b1.place(x=343,y=270)

question4.py
import tkinter as r
import tkinter.font as tkfont
question4=r.Tk()
question4.title("Question 4")
question4.configure(bg='cyan')
question4.geometry('770x500')
labelsty=tkfont.Font(family="Lucida Grande",size=10)
labelsty.configure(size=40)
l=r.Label(question4,font=labelsty,text='Question 4')
l.pack(side='top')
l.place()
l.configure(bg='cyan')

31
f1=tkfont.Font(family="Lucida Grande",size=10)
f1.configure(size=20)
f2=tkfont.Font(family="Lucida Grande",size=10)
f2.configure(size=15)
f3=tkfont.Font(family='Lucida Grande',size=10)
f3.configure(size=10)
l1=r.Label(question4,font=f1,text='Who will have gave good economy')
l1.place(x=140,y=170)
l1.configure(bg='cyan')
e1=r.Entry(question4,font=f1,width=11)
e1.place(x=167,y=220)
e2=r.Entry(question4,font=f1,width=11)
e2.place(x=405,y=220)
def nextq():
player1=e1.get()
player2=e2.get()
if(player1==player2):
l2=r.Label(question4,font=f3,text='Same player name cannot be given twice.')
l2.place(x=250,y=140)
l2.configure(bg='cyan')
else:
import openpyxl
wb=openpyxl.load_workbook("Project.xlsx")
sh1=wb['Sheet1']
c=sh1.max_column
name=sh1.cell(1,c).value
match=""
for i in name:
if(i=='%' or i=='7' or i=='8'):
pass
else:
match=match+i

32
match=match+'.txt'
f = open(match,'a+')
writeinto=['%','\n',player1,'\n','%','\n',player2,'\n']
f.writelines(writeinto)
f.close()
question4.destroy()
import home
b1=r.Button(question4,text='Next',font=f2,command=nextq)
b1.place(x=343,y=270)

home.py
import openpyxl
import tkinter as r
import tkinter.font as tkfont
def back():
home.destroy()
import user
def leaderboard():
import leaderboard
def bet():
home.destroy()
import bet1
def logoutc():
home.destroy()
import user
f =open("user.txt","r")
username = f.readline()
index= int(f.readline())
f.close()
print(username)
home=r.Tk()
home.title("HOME")
home.configure(bg='cyan')

33
home.geometry('770x500')
labelsty=tkfont.Font(family="Lucida Grande",size=10)
labelsty.configure(size=100)
l=r.Label(home,text='HOME',font=labelsty)
l.place(x=185)
l.configure(bg='cyan')
f1=tkfont.Font(family="Lucida Grande",size=10)
f1.configure(size=25)
f4=tkfont.Font(family="Lucida Grande",size=10)
f4.configure(size=15)
f3=tkfont.Font(family="Lucida Grande",size=10)
f3.configure(size=10)
b1=r.Button(home,text='Leaderboard',font=f1,command=leaderboard)
b1.pack()
b1.place(x=275,y=220)

b2=r.Button(home,text='Bet',font=f1,command=bet)
b2.pack()
b2.place(x=342,y=300)
b2=r.Button(home,text='Back',font=f3,command=back)
b2.place(x=15,y=450)
wb = openpyxl.load_workbook("Project.xlsx")
sh1= wb['Sheet1']
userid=[]
rows=sh1.max_row
frame=r.Frame(home)
frame.configure(bg='yellow')
login=r.Label(frame,text=str(sh1.cell(index,1).value),font=f4)
login.configure(bg='yellow')
points=r.Label(frame,text='Points : '+str(sh1.cell(index,3).value),font=f4)
points.configure(bg='yellow')
login.grid(row=1,column=1)

34
points.grid(row=2,column=1)
logout=r.Button(frame,text='logout',font=f4,command=logoutc)
logout.grid(row=3,column=1)
logout.configure(bg='violet')
frame.place(x=650,y=25)

bet1.py
import tkinter as r
import tkinter.font as tkfont
import re
import openpyxl
bet=r.Tk()
bet.title("PLAY")
bet.configure(bg='cyan')
labelsty=tkfont.Font(family="Lucida Grande",size=10)
labelsty.configure(size=100)
f1=tkfont.Font(family="Lucida Grande",size=10)
f1.configure(size=25)
def rohan():
roshan=ent.get()
filename=roshan+'.txt'
f1=open('name.txt','w')
f1.write(filename)
f1.close()
#print(filename)
bet.destroy()
import sorry
wb=openpyxl.load_workbook("Project.xlsx")
sh1=wb['Sheet1']
col=sh1.max_column
ro=sh1.max_row
matches=[]
l=0

35
for i in range(4,col,8):
if(sh1.cell(2,i).value=='#'):
newstr=""
present=sh1.cell(1,i).value
for k in range(0,len(present)-1):
newstr=newstr+present[k]
name_list=[]
name_list=re.findall('[A-Z][^A-Z]*',newstr)
name1=name_list[0]
name1=name1[:-1]
name2=name_list[1]
matches.append(name1+name2)
la=r.Label(bet,text=name1+' v/s '+name2,font=f1)
la.pack()
label=r.Label(bet,text="Enter the names of the two teams",font=f1)
label.pack()
ent=r.Entry(bet,font=f1)
ent.pack()
bu=r.Button(bet,text="Proceed",command=rohan)
bu.pack()

leaderboard.py
import tkinter as r
import tkinter.font as tkfont
leaderboard=r.Tk()
leaderboard.title("LEADERBOARD")
labelsty=tkfont.Font(family="Lucida Grande",size=10)
labelsty.configure(size=100)
import openpyxl
wb=openpyxl.load_workbook("Project.xlsx")
sh1=wb['Sheet1']
row=sh1.max_row
r.Label(leaderboard,text="Name of the user").grid(row=0,column=0)

36
r.Label(leaderboard,text="Points").grid(row=0,column=1)
for i in range(3,row+1):
r.Label(leaderboard,text=sh1.cell(i,1).value).grid(row=i-1,column=0)
r.Label(leaderboard,text=sh1.cell(i,3).value).grid(row=i-1,column=1)
leaderboard.mainloop()

leaderboard1.py
import openpyxl
wb=openpyxl.load_workbook("Project.xlsx")
sh1=wb['Sheet1']
row=sh1.max_row
col=sh1.max_column
inf=[]
ro=0
c=0
pos=-1
for i in range(3,row+1):
temp=[]
ro=ro+1
for j in range(1,col+1):
temp.append(sh1.cell(i,j).value)
inf.append(temp)
print(inf)
print("\n\n\n\n")
'''for i in range(0,ro+1):
for j in range(i,ro+1):
if(int(inf[i][2])<int(inf[j][2])):
pos=i
if(pos!=i):
temp=inf[i][:]
inf[j]=inf[i]
inf[i]=temp
'''sorted_inf=sorted(inf ,key=lambda x : x[2])

37
print(sorted_inf)
sorted_inf.reverse()
for i in range(3,row+1):
for j in range(1,col+1):
sh1.cell(row=i,column=j,value=sorted_inf[i-3][j-1])
wb.save("Project.xlsx")
import leaderboard

sorry.py
import tkinter as r
import tkinter.font as tkfont
import openpyxl
start=r.Tk()
f2=open('user.txt','r')
username=f2.readline()
pos=int(f2.readline())
f2.close()
fo1=tkfont.Font(family="Lucida Grande",size=10)
fo1.configure(size=25)
wb1=openpyxl.load_workbook("Project.xlsx")
sh1=wb1['Sheet1']
row=sh1.max_row
val=sh1.cell(pos,3).value
if(val<400):
l=r.Label(start,text="Sorry! No enough funds available.",font=fo1)
l.pack()
start.destroy()
exit(0)
else:
start.destroy()
import answer1

answer1.py

38
import tkinter as r
import tkinter.font as tkfont
answer1=r.Tk()
answer1.title("ANSWER THE FOLLOWING")
answer1.configure(bg='cyan')
answer1.geometry('770x500')
labelsty=tkfont.Font(family="Lucida Grande",size=10)
labelsty.configure(size=100)
l=r.Label(answer1,text='Question1',font=labelsty)
l.place(x=60)
l.configure(bg='cyan')
f1=tkfont.Font(family="Lucida Grande",size=10)
f1.configure(size=20)
fp1=open("name.txt","r")
filename=fp1.read()
fp1.close()
#print(filename)
fp1=open(filename,"r")
player=fp1.read()
players=player.split("\n")
#print(players)
fp1.close()
fp1=open("user.txt","r")
fp1.readline()
pos=int(fp1.readline())
fp1.close()
l1=r.Label(answer1,text="Who will hit the more number of sixes",font=f1)
l1.configure(bg='cyan')
l2=r.Label(answer1,text=players[1],font=f1)
e2=r.Entry(answer1,width=5,font=f1)
l3=r.Label(answer1,text=players[3],font=f1)
e3=r.Entry(answer1,width=5,font=f1)

39
l2.configure(bg='cyan')
l3.configure(bg='cyan')
l1.place(x=155,y=190)
l2.place(x=215,y=225)
l3.place(x=410,y=225)
e2.place(x=215,y=260)
e3.place(x=430,y=260)
def nextquestion():
option1=int(e2.get())
option2=int(e3.get())
#print(option1+option2)
if(option1+option2==100):
import openpyxl
wb=openpyxl.load_workbook("Project.xlsx")
sh1=wb['Sheet1']
matchname=filename[0]
#print(filename)
for i in range(1,len(filename)):
if(ord(filename[i])>=97):
matchname=matchname+filename[i]
elif(ord(filename[i])==46):
continue
else:
matchname=matchname+'%'+filename[i]
matchname=matchname[:-3]
matchname=matchname+'1'
#print(matchname)
col=sh1.max_column
for i in range(4,col,1):
if(matchname==sh1.cell(1,i).value):
break
else: pass

40
fp=open("answer.txt","w")
fp.write(str(i))
fp.close()
#print(i)
sh1.cell(row=pos,column=i,value=option1)
sh1.cell(row=pos,column=i+1,value=option2)
wb.save("Project.xlsx")
answer1.destroy()
import answer2
else:
l4=r.Label(answer1,text="Enter a sum of 100",font=f1)
l4.configure(bg='red')
l4.place(x=260,y=150)

b1=r.Button(answer1,text="NEXT",font=f1,command=nextquestion)
b1.place(x=315,y=310)

answer2.py
import tkinter as r
import tkinter.font as tkfont
answer2=r.Tk()
answer2.title("ANSWER THE FOLLOWING")
answer2.configure(bg='cyan')
answer2.geometry('770x500')
labelsty=tkfont.Font(family="Lucida Grande",size=10)
labelsty.configure(size=100)
l=r.Label(answer2,text='Question2',font=labelsty)
l.place(x=60)
l.configure(bg='cyan')
f1=tkfont.Font(family="Lucida Grande",size=10)
f1.configure(size=20)
fp1=open("name.txt","r")
filename=fp1.read()

41
fp1.close()
#print(filename)
fp1=open(filename,"r")
player=fp1.read()
players=player.split("\n")
#print(players)
fp1.close()
fp1=open("user.txt","r")
fp1.readline()
pos=int(fp1.readline())
fp1.close()
l1=r.Label(answer2,text="Who will take more number of catches",font=f1)
l1.configure(bg='cyan')
l2=r.Label(answer2,text=players[5],font=f1)
e2=r.Entry(answer2,width=5,font=f1)
l3=r.Label(answer2,text=players[7],font=f1)
e3=r.Entry(answer2,width=5,font=f1)
l2.configure(bg='cyan')
l3.configure(bg='cyan')
l1.place(x=155,y=190)
l2.place(x=215,y=225)
l3.place(x=410,y=225)
e2.place(x=215,y=260)
e3.place(x=430,y=260)
def nextquestion():
option1=int(e2.get())
option2=int(e3.get())
#print(option1+option2)
if(option1+option2==100):
import openpyxl
wb=openpyxl.load_workbook("Project.xlsx")
sh1=wb['Sheet1']

42
matchname=filename[0]
#print(filename)
for i in range(1,len(filename)):
if(ord(filename[i])>=97):
matchname=matchname+filename[i]
elif(ord(filename[i])==46):
continue
else:
matchname=matchname+'%'+filename[i]
matchname=matchname[:-3]
matchname=matchname+'3'
#print(matchname)
col=sh1.max_column
for i in range(4,col,1):
if(matchname==sh1.cell(1,i).value):
break
else: pass
fp=open("answer.txt","w")
fp.write(str(i))
fp.close()
#print(i)
sh1.cell(row=pos,column=i,value=option1)
sh1.cell(row=pos,column=i+1,value=option2)
wb.save("Project.xlsx")
answer2.destroy()
import answer3
else:
l4=r.Label(answer2,text="Enter a sum of 100",font=f1)
l4.configure(bg='red')
l4.place(x=260,y=150)
b1=r.Button(answer2,text="NEXT",font=f1,command=nextquestion)
b1.place(x=315,y=310)

43
answer3.py
import tkinter as r
import tkinter.font as tkfont
answer3=r.Tk()
answer3.title("ANSWER THE FOLLOWING")
answer3.configure(bg='cyan')
answer3.geometry('770x500')
labelsty=tkfont.Font(family="Lucida Grande",size=10)
labelsty.configure(size=100)
l=r.Label(answer3,text='Question3',font=labelsty)
l.place(x=60)
l.configure(bg='cyan')
f1=tkfont.Font(family="Lucida Grande",size=10)
f1.configure(size=20)

fp1=open("name.txt","r")
filename=fp1.read()
fp1.close()
#print(filename)
fp1=open(filename,"r")
player=fp1.read()
players=player.split("\n")
#print(players)
fp1.close()
fp1=open("user.txt","r")
fp1.readline()
pos=int(fp1.readline())
fp1.close()
l1=r.Label(answer3,text="Who will have more strike rate",font=f1)
l1.configure(bg='cyan')
l2=r.Label(answer3,text=players[9],font=f1)
e2=r.Entry(answer3,width=5,font=f1)

44
l3=r.Label(answer3,text=players[11],font=f1)
e3=r.Entry(answer3,width=5,font=f1)
l2.configure(bg='cyan')
l3.configure(bg='cyan')
l1.place(x=155,y=190)
l2.place(x=215,y=225)
l3.place(x=410,y=225)
e2.place(x=215,y=260)
e3.place(x=430,y=260)
def nextquestion():
option1=int(e2.get())
option2=int(e3.get())
#print(option1+option2)
if(option1+option2==100):
import openpyxl
wb=openpyxl.load_workbook("Project.xlsx")
sh1=wb['Sheet1']
matchname=filename[0]
#print(filename)
for i in range(1,len(filename)):
if(ord(filename[i])>=97):
matchname=matchname+filename[i]
elif(ord(filename[i])==46):
continue
else:
matchname=matchname+'%'+filename[i]
matchname=matchname[:-3]
matchname=matchname+'5'
#print(matchname)
col=sh1.max_column
for i in range(4,col,1):
if(matchname==sh1.cell(1,i).value):

45
break
else: pass
fp=open("answer.txt","w")
fp.write(str(i))
fp.close()
#print(i)
sh1.cell(row=pos,column=i,value=option1)
sh1.cell(row=pos,column=i+1,value=option2)
wb.save("Project.xlsx")
answer3.destroy()
import answer4
else:
l4=r.Label(answer3,text="Enter a sum of 100",font=f1)
l4.configure(bg='red')
l4.place(x=260,y=150)

b1=r.Button(answer3,text="NEXT",font=f1,command=nextquestion)
b1.place(x=315,y=310)\

answer4.py
import tkinter as r
import tkinter.font as tkfont
answer4=r.Tk()
answer4.title("ANSWER THE FOLLOWING")
answer4.configure(bg='cyan')
answer4.geometry('770x500')
labelsty=tkfont.Font(family="Lucida Grande",size=10)
labelsty.configure(size=100)
l=r.Label(answer4,text='Question4',font=labelsty)
l.place(x=60)
l.configure(bg='cyan')
f1=tkfont.Font(family="Lucida Grande",size=10)
f1.configure(size=20)

46
fp1=open("name.txt","r")
filename=fp1.read()
fp1.close()
#print(filename)
fp1=open(filename,"r")
player=fp1.read()
players=player.split("\n")
#print(players)
fp1.close()
fp1=open("user.txt","r")
fp1.readline()
pos=int(fp1.readline())
fp1.close()
l1=r.Label(answer4,text="Who will have good economy",font=f1)
l1.configure(bg='cyan')
l2=r.Label(answer4,text=players[13],font=f1)
e2=r.Entry(answer4,width=5,font=f1)
l3=r.Label(answer4,text=players[15],font=f1)
e3=r.Entry(answer4,width=5,font=f1)
l2.configure(bg='cyan')
l3.configure(bg='cyan')
l1.place(x=155,y=190)
l2.place(x=215,y=225)
l3.place(x=410,y=225)
e2.place(x=215,y=260)
e3.place(x=430,y=260)
def nextquestion():
option1=int(e2.get())
option2=int(e3.get())
#print(option1+option2)
if(option1+option2==100):
import openpyxl

47
wb=openpyxl.load_workbook("Project.xlsx")
sh1=wb['Sheet1']
matchname=filename[0]
#print(filename)
for i in range(1,len(filename)):
if(ord(filename[i])>=97):
matchname=matchname+filename[i]
elif(ord(filename[i])==46):
continue
else:
matchname=matchname+'%'+filename[i]
matchname=matchname[:-3]
matchname=matchname+'7'
#print(matchname)
col=sh1.max_column
for i in range(4,col,1):
if(matchname==sh1.cell(1,i).value):
break
else: pass
fp=open("answer.txt","w")
fp.write(str(i))
fp.close()
#print(i)
sh1.cell(row=pos,column=i,value=option1)
sh1.cell(row=pos,column=i+1,value=option2)
wb.save("Project.xlsx")
answer4.destroy()
if(pos==2):
import update1
else:
import home
else:

48
l4=r.Label(answer4,text="Enter a sum of 100",font=f1)
l4.configure(bg='red')
l4.place(x=260,y=150)
b1=r.Button(answer4,text="NEXT",font=f1,command=nextquestion)
b1.place(x=315,y=310)

49
7.OUTPUT

FIG: 7.1:Logging in as admin by executing as admin.py

FIG:7.2:Home page for admin executing matchsetup.py

50
FIG:7.3:Setting a match using prematch.py between India and Pakistan

FIG:7.4:Setting the options for question1 using question1.py

51
FIG:7.5:Setting the options for question1 using question1.py

FIG:7.6:Setting the options for question2 using question2.py

52
FIG:7.7:Setting the options for question3 using question3.py

FIG:7.8:Setting the options for question4 using question4.py

FIG:7.9:login and answer the questions set up now

53
FIG:7.10:Create user and password

FIG:7.11:Home page for leaderboard

500 points will be given as bonus points


Different options are displayed on the screen such as
 Leaderboard
 Bet / participate in the matches
 Logout of the account
 Go back to login page

54
Fig:7.12:Leader board using leaderboard1.py and leaderboard.py

Fig:7.13:Bet in the match using bet.py

Fig:7.14:Two matches are available so select one among them as

55
Fig:7.15:The admin can even add points to all the user using bonus by add.py

Now we can check the leader board positions, it will remain same but each account will be
increased by a total of 400 points as shown in the leaderboard

FIG:7.16:Upadated leaderboard

56
8. CONCLUSION

Fantasy League is a good time pass game and can be enjoyed free of cost. It is a very basic
game and provides a lot of fun and experience in betting. It involves a lot of effort from the
team members in bringing the game into lime light.Most importantly, its claen syntax offers
increased understanding and enjoyment for students.

57
9. FUTURE ENHANCEMENT

 The user can connect through his Facebook account and play contests with his friends.
 Increase in the number of events.
 Make it a web application rather than a console one.
 Improve the GUI and include the photos of teams and players while the user bets.
 To include the data on to a database and make it a kind of a mobile app.
 This app may be extended for football events.
 In addition, the user may invest real money into it and get some coupons in return.
 Link to cricinfo, such that answers will be feeded directly after the completion of the
match.

58
10.BIBLIOGRAPHY

1. F. &. Members, Interviewee, Primary Research & Analysis. [Interview]. 4 August 2021.
2. Rameesh Kailasam, Priyanka Mathur, “Fantasy Sports - Adding Value to the Indian
Sporting Ecosystem,” Indiatech, 2020.
3. Allied Market Research, “Fantasy Sports Market : Global Opportunity Analysis and
Industry Forecast, 2021 - 2027,” Allied Market Research, 2020.
4. Fantasy Sports & Gaming Association, “Industry Demographics,” 2017.
5. Arizton Advisory & Intelligence, “Fantasy Sports Market - Global Outlook and Forecast
2021-2026,” Arizton, 2021.
6. IBEF Research, “Indian Fantasy Sports Platforms Report Three-Fold Jump In FY20
Revenue,” India Brand Equity Foundation, 2020.
7. The Business Research Company, “Fantasy Sports Global Market Report 2021: COVID-
19 Growth And Change,” 2021.
8. Federation of Indian Fantasy Sports (FIFS) & Kantar, “Understanding the sports
consumption behaviour among fantasy sports users,” 2020.
9. Broadcast Audience Research Council India, “Cricket in India: It's not just a game,” 2019.
10. The Indian Federation of Sports Gaming (IFSG) & Nielsen, “Fantasy Sports: Measuring
its impact on actual sports consumption,” Nielsen, 2019.
11. Statista, “Share of televised sports viewership across India in 2019,” 2021.
12. Deloitte, “Women’s sports gets down to business: On track for rising monetization,”
TMT Predictions 2021, 07 December 2020.
13. B. L. Bureau, “Euro viewership on SonyLIV overtakes FIFA World Cup 2018,” Business
Line, 2021.
14. “Tokyo Olympics | Indian hockey ends 41-year wait for Olympic medal,” 5 August 2021.
[Online]. Available: https://www.thehindu.com/sport/hockey/india-beats-germany-5-4-to-
win-olympic-mens-hockey-medal-after-41-years/article35736495.ece. [Accessed 10
August 2021].
15. J. Boyd, “The Top 20 Most Followed Instagram Accounts,” Brandwatch, 4 August 2021.
[Online]. Available: https://www.brandwatch.com/blog/top-most-instagram-followers/.
[Accessed 10 August 2021].

59

You might also like