Kendriya Vidyalaya No.2 A.F.S Tambaram: Dots and Boxes Game
Kendriya Vidyalaya No.2 A.F.S Tambaram: Dots and Boxes Game
2
A.F.S TAMBARAM
pg. 1
KENDRIYA VIDYALAYA NO.2
A.F.S TAMBARAM
certificate
by (R.no
) to the Computer Department, Kendriya Vidyalaya
academicyear 2021-22.
PRINCIPAL
ACKNOWLEDGEMENT
1. INTRODUCTION
2. OBJECTIVE
3. DESIGN:
MODULES
USER
INTERFACE
BACKEND
HARDWARE&
SOFTWARE
ALGORITHM
4. ADVANTAGES
AND
DRAWBACKS
5. REFERENCE
INTRODUCTION
Dots and Boxes is a pencil-and-paper game for two players (sometimes more). It was
first published in the 19th century by French mathematician Édouard Lucas, who called
it la pipopipette.
It has gone by many other names, including the dots and dashes, game of dots,
dot to dot grid, boxes, and pigs in a pen.
Usually two players take turns adding a single horizontal or vertical line
between two unjoined adjacent dots.
A player who completes the fourth side of a 1×1 box earns one point and takes
another turn.
A point is typically recorded by placing a mark that identifies the player in the box,
such as an initial.
The game ends when no more lines can be placed. The winner is the player with
the most points.
The board may be of any size grid. When short on time, or to learn the game, a 2×2 board (3×3 dots) is
suitable. A 5×5 board, on the other hand, is good for experts.
The diagram on the right shows a game being played on a 2×2 board (3×3 dots).
The second player ("B") plays a rotated
mirror image of the first player's moves,
hoping to divide the board into two pieces and tie the game. But the first player
("A") makes a sacrifice at move 7 and B accepts the sacrifice, getting one box.
However, B must now add another line, and so B connects the center dot to the
center-right dot, causing the remaining unscored boxes to be joined together in a
chain (shown at the end of move 8). With A's next move, A gets all three of them
and ends the game, winning 3–1.
In combinatorial game theory, Dots and Boxes is an impartial game and many
positions can be analyzed using Sprague–Grundy theory. However, Dots and
Boxes lacks the normal play convention of most impartial games (where the last
player to move wins), which complicates the analysis considerably.
For most novice players, the game begins with a phase of more-or-less
randomly connecting dots, where the only strategy is to avoid adding the third
side to any box.
This continues until all the remaining (potential) boxes are joined together into
chains – groups of one or more adjacent boxes in which any move gives all the
boxes in the chain to the opponent.
At this point, players typically take all available boxes, then open the
smallest available chain to their opponent.
For example, a novice player faced with a situation like position 1 in the diagram on
the right, in which some boxes can be captured, may take all the boxes in the chain,
resulting in position 2. But, with their last move, they have to open the next, larger
chain, and the novice loses the game.
WHY DO YOU WANT TO DO?
Geometric
Logical
Considering how under-emphasized these parts of math can be in a typical classroom, this
game is a great supplement for kids of all ages.
opponents circle each other, adding lines in new locations while being careful not
to draw the third side on any box, lest their opponent claim that fourth side.
Eventually, of course, someone is going to run out of safe spots to play,
and the race for boxes begins in earnest.
Your child might begin to notice that if they create little chains of boxes across the
board, they can fill in multiple squares on a single turn. For example, in the image
below, the blue player is able to capture three boxes in a row by capturing the
chain of boxes that runs around the top left corner of the board.
Once you've played a couple of rounds on a 4x4 grid, you should move up to
larger grids such as 6x6 or 8x8 so that these chains of boxes become more
apparent to you and to your child.
Once you see the chains of boxes, you begin to look at the board with an even
more refined perspective on the spatial relationships that the board contains.
Each new insight into the strategy of the game allows you to see new things in
what would otherwise be a simplistic set of dots and lines.
Dots and Boxes is a game that helps your child, not with the arithmetic parts of
math, but with the geometric and logical elements of math that are the underpinning
of so much mathematical development.
Considering how under-emphasized these parts of math can be in a typical
classroom, this game is a great supplement for kids of all ages.
Questions to Ask
Dots and Boxes is a great game for questions with your kid, since the game is accessible
to kids as young as 5 while still being a strategic challenge for teenagers and adults.
For the younger kids, a great question to ask is "Is this line safe to draw?"You
can ask this question on your turn or on theirs, with the same goal in mind:
getting your child to determine whether a line will allow the opponent to claim
a box.
This sort of simple, repeated question can help your child hone in on the
strategy of the game.
Once your child has the basics down, you can start asking deeper questions to pull
out the strategy of the game. A great start is "How can you claim more than one box
in a turn?" You can even ask your child to draw a sample game board to show how
they can capture multiple boxes at once. Once they can create a chain of boxes on a
sample board, they can work toward building those chains in the game!
Lastly, you can always find some sort of puzzle in games like this. Here's a quick
one: How many lines can you draw without completing a single
box? That's a challenge that you and your child could both try!
DESIGN
MODULES
TKINTER
The tkinter package (“Tk interface”) is the standard Python interface to the
Tcl/Tk GUI toolkit. Both Tk and tkinter are available on most Unix
platforms, including macOS, as well as on Windows systems.
Running python -m tkinter from the command line should open a
window demonstrating a simple Tk interface, letting you know
that tkinter is properly installed on your system, and also showing what version
of Tcl/Tk is installed, so you can read the Tcl/Tk documentation specific to that
version.
Tkinter supports a range of Tcl/Tk versions, built either with or without thread
support. The official Python binary release bundles Tcl/Tk 8.6 threaded. See the
source code for the _tkinter module for more information about supported
versions.
Tkinter is not a thin wrapper, but adds a fair amount of its own logic to make the
experience more pythonic. This documentation will concentrate on these additions
and changes, and refer to the official Tcl/Tk documentation for details that are
unchanged.
Standard attributes
Let us take a look at how some of their common attributes.such as sizes, colors and fonts
are specified.
Dimensions
Colors
Fonts
Anchors
Relief styles
Bitmaps
cursors
Numpy
A CSV file stores tabular data (numbers and text) in plain text. Each line of the
file is a data record. Each record consists of one or more fields, separated by
commas.
The use of the comma as a field separator is the source of the name for this file
format.
For working CSV files in python, there is an inbuilt module called csv.
The csv module implements classes to read and write tabular data in CSV format.
It allows programmers to say, “write this data in the format preferred by Excel,” or “read
data from this file which was generated by Excel,” without knowing the precise details of
the CSV format used by Excel.
Programmers can also describe the CSV formats understood by other applications or
define their own special-purpose CSV formats.
USER INTERFACE
4. When all the edges are marked, the result is displayed on the result screen
CSV (Comma Separated Values) is a simple file format used to store tabular data,
such as a spreadsheet or database.
A CSV file stores tabular data (numbers and text) in plain text. Each line of the
file is a data record.
Each record consists of one or more fields, separated by commas. The use of the
comma as a field separator is the source of the name for this file format.
In this python project the data is stored inside a csv file where the data of no of
rounds
winners list
is been stored and will be fetched when the game ends on the screen for
summary
HARDWARE AND SOFTWARE REQUIRMENT
Hardware Requirement:
Software Requirement:
Windows 7 or higher
Python latest
Pycharm
ALGORITHM
dimensions
Advantages
Limitation
Application
This system can be used by the multiple peoples to get the advantage of the
game
REFERENCE
https://www.google.com/
https://github.com/
https://www.youtube.com/