SlideShare a Scribd company logo
1 of 16
SOFT WARE LAB 
PROJECT REPORT 
TOWER OF 
HANOI
SUBMITTED TO: 
Sayed Monower Hossain 
Lecturer 
Department of Computer Science And Engineering. 
University of Dhaka. 
SUBMITTED BY: 
Iffat Anjum 
Roll: 16. 
Mohammad Maruful Haque 
Roll:37. 
Abdullah Al - Matin 
Roll:23. 
Batch:15. 
SUBMISSION DATE: 
04/03/2010.
TOWER OF HANOI : 
Tower of Hanoi or Towers of Hanoi is a mathematical 
game or puzzle. It consists of three rods, and a number of disks of different sizes 
which can slide onto any rod. The puzzle starts with the disks in a neat stack in 
ascending order of size on one rod, the smallest at the top, thus making a 
conical shape.
OBJECTIVE OF TOWER OF HANOI: 
The objective of the puzzle is to move the entire stack to 
another rod, obeying the following rules: 
* Only one disk can be moved at a time. 
* Each move consists of taking the upper disk from one of 
the rods and sliding it onto another rod, on top of the other disks that may 
already be present on that rod. 
* No disk can be placed on top of a smaller disk than itself.
OBJECTIVE OF THE PROJECT: 
In this project our main goal is to take number of 
disks from the user to show how the concept of tower of Hanoi works . 
In this project we show how the disks replace from 
the first tower to the 3rd tower without placing the larger disks over the smaller 
disks. 
For showing all this facts we have used mainly the 
glut.h and also iGraphics.h…. 
We have mainly used iGraphics for the project. 
And used recursion formula for indicating the 
placements.
We have used recursion formula for solving tower of 
Hanoi…….. 
void tower(int n,int sr,int md,int ds) 
{ 
if(n==1) 
{ a[p++]=sr; 
b[q++]=ds; 
} 
else 
{ 
tower(n-1, sr, ds, md); 
a[p++]=sr; 
b[q++]=ds; 
tower(n-1, md, sr, ds); 
} 
}
THE FUNCTIONS : 
We have used void DrawRectangle (rect A, int x) for drawing rectangle shape 
of the piles. 
We have used void initPile() to determine height,width & placements of the 
piles. 
We used void mvup() to move piles up-ward. 
We have used void mvside() to move the piles sidely. 
We have used void mvdown() to move the piles down-ward. 
We have used void iDraw() to draw the graphics.
THE FUNCTIONS : 
We have used void iMouse(int button, int state, int mx, int my) for 
controlling over mouse movement. 
We have used void iKeyboard(unsigned char key) to control over Keyboard. 
iInitialize() to determine the window size & the name of the programe. 
tower(int n,int sr,int md,int ds) to save the movement of piles in array. 
int main() is the main function that calls all the functions we have used .
Now we showing the steps of the replacements. for easy going we taking three 
disks. We need seven moves here. 
THE FIRST MOVE:
SECOND MOVE:
THIRD MOVE:
FORTH MOVE:
FIFTH MOVE:
SIXETH MOVE:
SEVENTH MOVE:
Reference books : 
1.ANSI C++ 
( E Balagurusamy) 
3. Graphics under C 
(Yashavant Kanetkar) 
Acknowledgement : 
www.google.com.bd/ 
www.cplusplus.com 
www.cse.univdhaka.edu/~cse102/

More Related Content

What's hot

Quick sort-Data Structure
Quick sort-Data StructureQuick sort-Data Structure
Quick sort-Data StructureJeanie Arnoco
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notationsNikhil Sharma
 
8 queens problem using back tracking
8 queens problem using back tracking8 queens problem using back tracking
8 queens problem using back trackingTech_MX
 
B trees in Data Structure
B trees in Data StructureB trees in Data Structure
B trees in Data StructureAnuj Modi
 
Algorithms Lecture 6: Searching Algorithms
Algorithms Lecture 6: Searching AlgorithmsAlgorithms Lecture 6: Searching Algorithms
Algorithms Lecture 6: Searching AlgorithmsMohamed Loey
 
The n Queen Problem
The n Queen ProblemThe n Queen Problem
The n Queen ProblemSukrit Gupta
 
Deque and its applications
Deque and its applicationsDeque and its applications
Deque and its applicationsJsaddam Hussain
 
Topological Sorting
Topological SortingTopological Sorting
Topological SortingShahDhruv21
 
heap Sort Algorithm
heap  Sort Algorithmheap  Sort Algorithm
heap Sort AlgorithmLemia Algmri
 
Data Structures : hashing (1)
Data Structures : hashing (1)Data Structures : hashing (1)
Data Structures : hashing (1)Home
 
Bubble sort
Bubble sortBubble sort
Bubble sortManek Ar
 
3.8 quick sort
3.8 quick sort3.8 quick sort
3.8 quick sortKrish_ver2
 
Red black tree
Red black treeRed black tree
Red black treeRajendran
 
Threaded Binary Tree
Threaded Binary TreeThreaded Binary Tree
Threaded Binary Treekhabbab_h
 

What's hot (20)

Quick sort-Data Structure
Quick sort-Data StructureQuick sort-Data Structure
Quick sort-Data Structure
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
 
Floyd Warshall Algorithm
Floyd Warshall AlgorithmFloyd Warshall Algorithm
Floyd Warshall Algorithm
 
8 queens problem using back tracking
8 queens problem using back tracking8 queens problem using back tracking
8 queens problem using back tracking
 
B trees in Data Structure
B trees in Data StructureB trees in Data Structure
B trees in Data Structure
 
Algorithms Lecture 6: Searching Algorithms
Algorithms Lecture 6: Searching AlgorithmsAlgorithms Lecture 6: Searching Algorithms
Algorithms Lecture 6: Searching Algorithms
 
Tower of hanoi
Tower of hanoiTower of hanoi
Tower of hanoi
 
The n Queen Problem
The n Queen ProblemThe n Queen Problem
The n Queen Problem
 
Deque and its applications
Deque and its applicationsDeque and its applications
Deque and its applications
 
Topological Sorting
Topological SortingTopological Sorting
Topological Sorting
 
Extensible hashing
Extensible hashingExtensible hashing
Extensible hashing
 
heap Sort Algorithm
heap  Sort Algorithmheap  Sort Algorithm
heap Sort Algorithm
 
Heap tree
Heap treeHeap tree
Heap tree
 
Data Structures : hashing (1)
Data Structures : hashing (1)Data Structures : hashing (1)
Data Structures : hashing (1)
 
Bubble sort
Bubble sortBubble sort
Bubble sort
 
3.8 quick sort
3.8 quick sort3.8 quick sort
3.8 quick sort
 
Red black tree
Red black treeRed black tree
Red black tree
 
Threaded Binary Tree
Threaded Binary TreeThreaded Binary Tree
Threaded Binary Tree
 
Digital Search Tree
Digital Search TreeDigital Search Tree
Digital Search Tree
 
N queen problem
N queen problemN queen problem
N queen problem
 

Viewers also liked

Towers Hanoi Algorithm
Towers Hanoi AlgorithmTowers Hanoi Algorithm
Towers Hanoi AlgorithmJorge Jasso
 
Tower of Hanoi using AI technique - means ends analysis
Tower of Hanoi using AI technique - means ends analysisTower of Hanoi using AI technique - means ends analysis
Tower of Hanoi using AI technique - means ends analysisShubham Nimiwal
 
Tower of hanoi problem
Tower of hanoi problemTower of hanoi problem
Tower of hanoi problemTyler Murphy
 
towers of hanoi
towers of hanoitowers of hanoi
towers of hanoistudent
 
Dossier general(school programs)
Dossier general(school programs)Dossier general(school programs)
Dossier general(school programs)Aaquib Hussain
 
Summer Day Camp for the Sports Minded Child
Summer Day Camp for the Sports Minded ChildSummer Day Camp for the Sports Minded Child
Summer Day Camp for the Sports Minded ChildBuzz Marketing Pros
 
Summer Youth Camp - Baby Mixup
Summer Youth Camp - Baby MixupSummer Youth Camp - Baby Mixup
Summer Youth Camp - Baby MixupKen Sapp
 
Summer Youth Camp - Knock Down, or Build Up
Summer Youth Camp - Knock Down, or Build UpSummer Youth Camp - Knock Down, or Build Up
Summer Youth Camp - Knock Down, or Build UpKen Sapp
 
CyberTerrorism - A case study for Emergency Management
CyberTerrorism - A case study for Emergency ManagementCyberTerrorism - A case study for Emergency Management
CyberTerrorism - A case study for Emergency ManagementRicardo Reis
 
Presentation Summer Camp
Presentation Summer CampPresentation Summer Camp
Presentation Summer Campsanjibk
 
How to make a proposal
How to make a proposalHow to make a proposal
How to make a proposalsilasyao
 
RECURSION IN C
RECURSION IN C RECURSION IN C
RECURSION IN C v_jk
 

Viewers also liked (20)

Tower of Hanoi
Tower of HanoiTower of Hanoi
Tower of Hanoi
 
Towers Hanoi Algorithm
Towers Hanoi AlgorithmTowers Hanoi Algorithm
Towers Hanoi Algorithm
 
Tower of Hanoi using AI technique - means ends analysis
Tower of Hanoi using AI technique - means ends analysisTower of Hanoi using AI technique - means ends analysis
Tower of Hanoi using AI technique - means ends analysis
 
Tower of hanoi problem
Tower of hanoi problemTower of hanoi problem
Tower of hanoi problem
 
towers of hanoi
towers of hanoitowers of hanoi
towers of hanoi
 
Tower of hanoi
Tower of hanoiTower of hanoi
Tower of hanoi
 
Dossier general(school programs)
Dossier general(school programs)Dossier general(school programs)
Dossier general(school programs)
 
Summer Day Camp for the Sports Minded Child
Summer Day Camp for the Sports Minded ChildSummer Day Camp for the Sports Minded Child
Summer Day Camp for the Sports Minded Child
 
Summer Youth Camp - Baby Mixup
Summer Youth Camp - Baby MixupSummer Youth Camp - Baby Mixup
Summer Youth Camp - Baby Mixup
 
Summer Youth Camp - Knock Down, or Build Up
Summer Youth Camp - Knock Down, or Build UpSummer Youth Camp - Knock Down, or Build Up
Summer Youth Camp - Knock Down, or Build Up
 
CyberTerrorism - A case study for Emergency Management
CyberTerrorism - A case study for Emergency ManagementCyberTerrorism - A case study for Emergency Management
CyberTerrorism - A case study for Emergency Management
 
Presentation Summer Camp
Presentation Summer CampPresentation Summer Camp
Presentation Summer Camp
 
I Mouse
I MouseI Mouse
I Mouse
 
Ch 7 recursion
Ch 7 recursionCh 7 recursion
Ch 7 recursion
 
How to make a proposal
How to make a proposalHow to make a proposal
How to make a proposal
 
Summer camp proposal
Summer camp proposalSummer camp proposal
Summer camp proposal
 
Daa tutorial
Daa tutorialDaa tutorial
Daa tutorial
 
Recursion
RecursionRecursion
Recursion
 
Recursion
RecursionRecursion
Recursion
 
RECURSION IN C
RECURSION IN C RECURSION IN C
RECURSION IN C
 

More from Iffat Anjum

Fog computing ( foggy cloud)
Fog computing  ( foggy cloud)Fog computing  ( foggy cloud)
Fog computing ( foggy cloud)Iffat Anjum
 
Cognitive radio network_MS_defense_presentation
Cognitive radio network_MS_defense_presentationCognitive radio network_MS_defense_presentation
Cognitive radio network_MS_defense_presentationIffat Anjum
 
Lecture 15 run timeenvironment_2
Lecture 15 run timeenvironment_2Lecture 15 run timeenvironment_2
Lecture 15 run timeenvironment_2Iffat Anjum
 
Lecture 16 17 code-generation
Lecture 16 17 code-generationLecture 16 17 code-generation
Lecture 16 17 code-generationIffat Anjum
 
Lecture 14 run time environment
Lecture 14 run time environmentLecture 14 run time environment
Lecture 14 run time environmentIffat Anjum
 
Lecture 12 intermediate code generation
Lecture 12 intermediate code generationLecture 12 intermediate code generation
Lecture 12 intermediate code generationIffat Anjum
 
Lecture 13 intermediate code generation 2.pptx
Lecture 13 intermediate code generation 2.pptxLecture 13 intermediate code generation 2.pptx
Lecture 13 intermediate code generation 2.pptxIffat Anjum
 
Lecture 11 semantic analysis 2
Lecture 11 semantic analysis 2Lecture 11 semantic analysis 2
Lecture 11 semantic analysis 2Iffat Anjum
 
Lecture 09 syntax analysis 05
Lecture 09 syntax analysis 05Lecture 09 syntax analysis 05
Lecture 09 syntax analysis 05Iffat Anjum
 
Lecture 10 semantic analysis 01
Lecture 10 semantic analysis 01Lecture 10 semantic analysis 01
Lecture 10 semantic analysis 01Iffat Anjum
 
Lecture 07 08 syntax analysis-4
Lecture 07 08 syntax analysis-4Lecture 07 08 syntax analysis-4
Lecture 07 08 syntax analysis-4Iffat Anjum
 
Lecture 06 syntax analysis 3
Lecture 06 syntax analysis 3Lecture 06 syntax analysis 3
Lecture 06 syntax analysis 3Iffat Anjum
 
Lecture 05 syntax analysis 2
Lecture 05 syntax analysis 2Lecture 05 syntax analysis 2
Lecture 05 syntax analysis 2Iffat Anjum
 
Lecture 03 lexical analysis
Lecture 03 lexical analysisLecture 03 lexical analysis
Lecture 03 lexical analysisIffat Anjum
 
Lecture 04 syntax analysis
Lecture 04 syntax analysisLecture 04 syntax analysis
Lecture 04 syntax analysisIffat Anjum
 
Lecture 02 lexical analysis
Lecture 02 lexical analysisLecture 02 lexical analysis
Lecture 02 lexical analysisIffat Anjum
 
Lecture 01 introduction to compiler
Lecture 01 introduction to compilerLecture 01 introduction to compiler
Lecture 01 introduction to compilerIffat Anjum
 
Compiler Design - Introduction to Compiler
Compiler Design - Introduction to CompilerCompiler Design - Introduction to Compiler
Compiler Design - Introduction to CompilerIffat Anjum
 
Distributed contention based mac protocol for cognitive radio
Distributed contention based mac protocol for cognitive radioDistributed contention based mac protocol for cognitive radio
Distributed contention based mac protocol for cognitive radioIffat Anjum
 
On qo s provisioning in context aware wireless sensor networks for healthcare
On qo s provisioning in context aware wireless sensor networks for healthcareOn qo s provisioning in context aware wireless sensor networks for healthcare
On qo s provisioning in context aware wireless sensor networks for healthcareIffat Anjum
 

More from Iffat Anjum (20)

Fog computing ( foggy cloud)
Fog computing  ( foggy cloud)Fog computing  ( foggy cloud)
Fog computing ( foggy cloud)
 
Cognitive radio network_MS_defense_presentation
Cognitive radio network_MS_defense_presentationCognitive radio network_MS_defense_presentation
Cognitive radio network_MS_defense_presentation
 
Lecture 15 run timeenvironment_2
Lecture 15 run timeenvironment_2Lecture 15 run timeenvironment_2
Lecture 15 run timeenvironment_2
 
Lecture 16 17 code-generation
Lecture 16 17 code-generationLecture 16 17 code-generation
Lecture 16 17 code-generation
 
Lecture 14 run time environment
Lecture 14 run time environmentLecture 14 run time environment
Lecture 14 run time environment
 
Lecture 12 intermediate code generation
Lecture 12 intermediate code generationLecture 12 intermediate code generation
Lecture 12 intermediate code generation
 
Lecture 13 intermediate code generation 2.pptx
Lecture 13 intermediate code generation 2.pptxLecture 13 intermediate code generation 2.pptx
Lecture 13 intermediate code generation 2.pptx
 
Lecture 11 semantic analysis 2
Lecture 11 semantic analysis 2Lecture 11 semantic analysis 2
Lecture 11 semantic analysis 2
 
Lecture 09 syntax analysis 05
Lecture 09 syntax analysis 05Lecture 09 syntax analysis 05
Lecture 09 syntax analysis 05
 
Lecture 10 semantic analysis 01
Lecture 10 semantic analysis 01Lecture 10 semantic analysis 01
Lecture 10 semantic analysis 01
 
Lecture 07 08 syntax analysis-4
Lecture 07 08 syntax analysis-4Lecture 07 08 syntax analysis-4
Lecture 07 08 syntax analysis-4
 
Lecture 06 syntax analysis 3
Lecture 06 syntax analysis 3Lecture 06 syntax analysis 3
Lecture 06 syntax analysis 3
 
Lecture 05 syntax analysis 2
Lecture 05 syntax analysis 2Lecture 05 syntax analysis 2
Lecture 05 syntax analysis 2
 
Lecture 03 lexical analysis
Lecture 03 lexical analysisLecture 03 lexical analysis
Lecture 03 lexical analysis
 
Lecture 04 syntax analysis
Lecture 04 syntax analysisLecture 04 syntax analysis
Lecture 04 syntax analysis
 
Lecture 02 lexical analysis
Lecture 02 lexical analysisLecture 02 lexical analysis
Lecture 02 lexical analysis
 
Lecture 01 introduction to compiler
Lecture 01 introduction to compilerLecture 01 introduction to compiler
Lecture 01 introduction to compiler
 
Compiler Design - Introduction to Compiler
Compiler Design - Introduction to CompilerCompiler Design - Introduction to Compiler
Compiler Design - Introduction to Compiler
 
Distributed contention based mac protocol for cognitive radio
Distributed contention based mac protocol for cognitive radioDistributed contention based mac protocol for cognitive radio
Distributed contention based mac protocol for cognitive radio
 
On qo s provisioning in context aware wireless sensor networks for healthcare
On qo s provisioning in context aware wireless sensor networks for healthcareOn qo s provisioning in context aware wireless sensor networks for healthcare
On qo s provisioning in context aware wireless sensor networks for healthcare
 

Recently uploaded

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

Tower of hanoi

  • 1. SOFT WARE LAB PROJECT REPORT TOWER OF HANOI
  • 2. SUBMITTED TO: Sayed Monower Hossain Lecturer Department of Computer Science And Engineering. University of Dhaka. SUBMITTED BY: Iffat Anjum Roll: 16. Mohammad Maruful Haque Roll:37. Abdullah Al - Matin Roll:23. Batch:15. SUBMISSION DATE: 04/03/2010.
  • 3. TOWER OF HANOI : Tower of Hanoi or Towers of Hanoi is a mathematical game or puzzle. It consists of three rods, and a number of disks of different sizes which can slide onto any rod. The puzzle starts with the disks in a neat stack in ascending order of size on one rod, the smallest at the top, thus making a conical shape.
  • 4. OBJECTIVE OF TOWER OF HANOI: The objective of the puzzle is to move the entire stack to another rod, obeying the following rules: * Only one disk can be moved at a time. * Each move consists of taking the upper disk from one of the rods and sliding it onto another rod, on top of the other disks that may already be present on that rod. * No disk can be placed on top of a smaller disk than itself.
  • 5. OBJECTIVE OF THE PROJECT: In this project our main goal is to take number of disks from the user to show how the concept of tower of Hanoi works . In this project we show how the disks replace from the first tower to the 3rd tower without placing the larger disks over the smaller disks. For showing all this facts we have used mainly the glut.h and also iGraphics.h…. We have mainly used iGraphics for the project. And used recursion formula for indicating the placements.
  • 6. We have used recursion formula for solving tower of Hanoi…….. void tower(int n,int sr,int md,int ds) { if(n==1) { a[p++]=sr; b[q++]=ds; } else { tower(n-1, sr, ds, md); a[p++]=sr; b[q++]=ds; tower(n-1, md, sr, ds); } }
  • 7. THE FUNCTIONS : We have used void DrawRectangle (rect A, int x) for drawing rectangle shape of the piles. We have used void initPile() to determine height,width & placements of the piles. We used void mvup() to move piles up-ward. We have used void mvside() to move the piles sidely. We have used void mvdown() to move the piles down-ward. We have used void iDraw() to draw the graphics.
  • 8. THE FUNCTIONS : We have used void iMouse(int button, int state, int mx, int my) for controlling over mouse movement. We have used void iKeyboard(unsigned char key) to control over Keyboard. iInitialize() to determine the window size & the name of the programe. tower(int n,int sr,int md,int ds) to save the movement of piles in array. int main() is the main function that calls all the functions we have used .
  • 9. Now we showing the steps of the replacements. for easy going we taking three disks. We need seven moves here. THE FIRST MOVE:
  • 16. Reference books : 1.ANSI C++ ( E Balagurusamy) 3. Graphics under C (Yashavant Kanetkar) Acknowledgement : www.google.com.bd/ www.cplusplus.com www.cse.univdhaka.edu/~cse102/