Sudoku python project report PDF

Title Sudoku python project report
Author Nagendra Babu Naidu
Course PYTHON
Institution Lovely Professional University
Pages 7
File Size 120.6 KB
File Type PDF
Total Downloads 93
Total Views 151

Summary

Python project ...


Description

ABSTRACT In this report, we present the detailed development and implementation of simple Sudoku game. The Sudoku game consists of graphical user interface, puzzle solver; implemented using python. The solver finds the solution to the puzzles entered by the user. This project gives an insight in to the different aspects of python programming.

INTRODUCTION Sudoku is the Japanese abbreviation of a phrase meaning the digits must remain single, also known as Number Place, where Su means number, doku which translates as single or bachelor. Sudoku is not a mathematical or arithmetical puzzle. It works just as well if the numbers are substituted with letters or some other symbols, but numbers work best. The aim of the puzzle is to enter a numerical digit from 1 through 9 in each cell of a 9×9 grid made up of 3×3 subsquares or subgrids, starting with various digits given in some cells; each row, column, and subsquares region must contain each of the numbers 1 to 9 exactly once. Throughout this document we refer to the whole puzzle as the grid/game board, a 3x3 subgrid as a block and the individual grids that contains the number as a cell.

History:

The first Sudoku puzzle was created in 1979. In New York City the Sudoku puzzle appear first, which was published by the specialist puzzle publisher Dell Magazines in their magazine Dell Pencil Puzzles and word Games. First it was printed under the name “number place”. Howard Garns, a retired architect and freelance puzzle constructor designed this first puzzle. This mathematical construction is inspired by the Latin square, invention of Leonhard Euler. Later the puzzle was introduced in Japan by Nikoli during 1984 as "Suji wa dokushin ni kagiru", which can be translated as "the numbers must be single" or "the numbers must occur only once", later it abbreviated as Sudoku. The Sudoku puzzle can use symbols or colors instead of numerals.Sudoku is still a trademark owned by Nikoli. The the game's popularity really took off in 2005; it can now be found in many newspapers and magazines around the world.

Rules: Solving a Sudoku puzzle can be rather tricky, but the rules of the game are quite simple. Solving a sudoku puzzle does not require knowledge of mathematics; simple logic suffices. The objective of sudoku is to enter a digit from 1 through 9 in each cell, in such a way that: I. Each horizontal row contains each digit exactly once II. Each vertical column contains each digit exactly once III. Each subgrid or region contains each digit exactly once

MODULES

Tkinter module: Tkinter is the standard GUI library for Python. Python when combined with Tkinter provides a fast and easy way to create GUI applications. Tkinter provides a powerful objectoriented interface to the Tk GUI toolkit. Creating a GUI application using Tkinter is an easy task. All you need to do is perform the following steps −  Import the Tkinter module.  Create the GUI application main window.  Add one or more of the above-mentioned widgets to the GUI application.  Enter the main event loop to take action against each event triggered by the user.

Tkinter Widgets Tkinter provides various controls, such as buttons, labels and text boxes used in a GUI application. These controls are commonly called widgets.

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 Let us study them briefly −

Geometry Management All Tkinter widgets have access to specific geometry management methods, which have the purpose of organizing widgets throughout the parent widget area. Tkinter exposes the following geometry manager classes: pack, grid, and place.  The pack() Method − This geometry manager organizes widgets in blocks before placing them in the parent widget.  The grid() Method − This geometry manager organizes widgets in a table-like structure in the parent widget.  The place() Method − This geometry manager organizes widgets by placing them in a specific position in the parent widget.

OS module: The OS module in python provides functions for interacting with the operating system. OS, comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality. The *os* and *os.path* modules include many functions to interact with the file system.

Following are some functions in OS module: 1. os.name: This function gives the name of the operating system dependent module imported. The following names have currently been registered: ‘posix’, ‘nt’, ‘os2’, ‘ce’, ‘java’ and ‘riscos’ 2. os.getcwd(): Function os.getcwd(), returns the Current Working Directory(CWD) of the file used to execute the code, can vary from system to system. filter_none 3. os.error: All functions in this module raise OSError in the case of invalid or inaccessible file names and paths, or other arguments that have the correct type, but are not accepted by the operating system. os.error is an alias for built-in OSError exception. 4. os.popen(): This method opens a pipe to or from command. The return value can be read or written depending on whether mode is ‘r’ or ‘w’. 5. os.close(): Close file descriptor fd. A file opened using open(), can be closed by close()only. But file opened through os.popen(), can be closed with close() or os.close(). If we try closing a file opened with open(), using os.close(), Python would throw TypeError. 6. os.rename(): A file old.txt can be renamed to new.txt, using the function os.rename(). The name of the file changes only

if, the file exists and user has sufficient privilege permission to change the file.

LIBRARYS USED: 1. strings 2. File handling and Exception handling 3. Classes and objects 4. Range function 5. For loop 6. if…elif…else statements 7. Buttons and its properties(GUI)

TEAM WORK: 1. Naidu.NagendraBabu_11805086_Roll.no-A17 ---- Filehandling, Exceptionalhandling, coding 2. Shaik HidayTulla-_11804627_B43 ---- Graphical User Interface 3. Gadde Satwik_11801553_A03 ---- Librarys, ideology

REFERENCES: 1. 2.

https://www.geeksforgeeks.org/sudoku-backtracking-7/ https://stackoverflow.com/questions/1697334/algorithmfor-solving-sudoku/...


Similar Free PDFs