0% found this document useful (0 votes)
17 views7 pages

Program Ai

Uploaded by

mryasir969
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views7 pages

Program Ai

Uploaded by

mryasir969
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

OUTPUT:- Depth first search algorithm.

['A', 'C', 'F', 'E', 'B', 'D']

OUTPUT:- Breadth first search algorithm.

BDAECF

OUTPUT:- simulate 4-Queen / N-Queen problem.

Enter n: 4

.Q..

...Q

Q...

..Q.

..Q.

Q...

...Q

.Q..

Number of solutions: 2

OUTPUT:- solve tower of Hanoi problem.

moving disk from A to B

moving disk from A to C

moving disk from B to C

moving disk from A to B

moving disk from C to A

moving disk from C to B

moving disk from A to B

OUTPUT:- implement A* algorithm.


HELLO WORLD

[(None, ''), ('H', 'H'), ('E', 'HE'), ('L', 'HEL'), ('L', 'HELL'), ('O', 'HELLO'), (' ',
'HELLO '), ('W', 'HELLO W'), ('O', 'HELLO WO'), ('R', 'HELLO WOR'), ('L',
'HELLO WORL'), ('D', 'HELLO WORLD')]

OUTPUT:- solve water jug problem.

JUG1 JUG2

0 0

5 0

0 5

5 5

3 7

0 3

5 3

1 7

0 1

5 1

0 6

5 6

4 7

0 4

Output:- shuffle a deck of card using the module random and draw 5 cards

you got:

2 of Heart

10 of Spade

13 of Diamond

10 of Club

8 of Heart

Output:- simulate number puzzle problem.

Move number None


4-1-2

7-e-3

8-5-6

Move number 5

4-1-2

7-5-3

8-e-6

Move number 8

4-1-2

7-5-3

e-8-6

Move number 7

4-1-2

e-5-3

7-8-6

Move number 4

e-1-2

4-5-3

7-8-6

Move number 1

1-e-2

4-5-3

7-8-6

Move number 2

1-2-e

4-5-3

7-8-6

Move number 3

1-2-3
4-5-e

7-8-6

Move number 6

1-2-3

4-5-6

7-8-e

OUTPUT:- Design the simulation of TIC – TAC –TOE game using min-max
algorithm.

Tic-Tac-Toe Game

Player 1 [X] --- Player 2 [O]

Please Wait...

| |

___|___|___

| |

___|___|___

| |

||

Player 1's chance

Enter the position between [1-9] where you want to mark :1

X| |

___|___|___

| |

___|___|___

| |
||

Player 2's chance

Enter the position between [1-9] where you want to mark :5

X| |

___|___|___

|O|

___|___|___

| |

||

Player 1's chance

Enter the position between [1-9] where you want to mark :3

X| |X

___|___|___

|O|

___|___|___

| |

||

Player 2's chance

Enter the position between [1-9] where you want to mark :2

X|O|X

___|___|___

|O|

___|___|___

| |

||

Player 1's chance

Enter the position between [1-9] where you want to mark :8

X|O|X

___|___|___
|O|

___|___|___

|X|

||

Player 2's chance

Enter the position between [1-9] where you want to mark :4

X|O|X

___|___|___

O|O|

___|___|___

|X|

||

Player 1's chance

Enter the position between [1-9] where you want to mark :6

X|O|X

___|___|___

O|O|X

___|___|___

|X|

||

Player 2's chance

Enter the position between [1-9] where you want to mark :7

X|O|X

___|___|___

O|O|X

___|___|___

O|X|

||

Player 1's chance


Enter the position between [1-9] where you want to mark :9

X|O|X

___|___|___

O|O|X

___|___|___

O|X|X

||

Player 1 Won

You might also like