Posts

Artificial Intelligence - 6

Image
  AIM: Write a program to create tic-tac-toe game using the alpha-beta algorithm. Consider following steps to create a program in python:      1.     Create class StateNode with its proper members (getScoreValue(), isValidMove(), isGameOver(), drawboard(), getEmptyCells(), setMove(), isWin(), etc.) 2.     Create class ticTacToe with its proper members (alphabeta(), computerMove(), playerMove(), execution(), etc.) 3.     Create appropriate heuristic function to solve this problem 4.     Use only math, random, matplotlib libraries in python Program: from math import inf as infinity from random import choice import platform import time from os import system   HUMAN = -1 COMP = +1 board = [     [0, 0, 0],     [0, 0,...

Artificial Intelligence - 5

Image
  AIM: Write a program to solve N-Queen problem using the A* search algorithm with Priority Queue and also find Execution time, completeness of algorithm, etc. Consider following steps to create a program in python: 1.     Create class queen and state with appropriate member variables      2.     Create class state with support of compare state & sort state 3.     Create appropriate heuristic function to solve this problem 4.     Use random, time, heapq and matplotlib libraries of python 5.      Output   should   be   according   to   given   image Program:   import time import queue import random import numpy as np import matplotlib.pyplot as plt from heapq import heappush, heappop, heapify   N = int(input("How Many Queen...