This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#matrix = [ [1, 1, 1], [1, 1, 1], [1, 1, 1] ] | |
#rows = 3 | |
#cols = 3 | |
#src = (0, 0) | |
#dest = (2, 2) | |
class Maze: | |
def __init__(self, matrix, rows, cols, src, dest): | |
self.matrix = matrix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
matrix = [ [1, 1, 0], [0, 1, 0], [0, 1, 1] ] | |
rows = 3 | |
cols = 3 | |
src = (0, 1) | |
dest = (2, 2) | |
def find_path(x, y): | |
if x >= rows or y >= cols or x < 0 or y < 0: | |
return False | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alphas = [ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] | |
def get_pattern(test_str): | |
key_pad = dict() | |
ite_alpha = 0 #iterates over all alphabets | |
digits = 2 #digits varialble takes values from 2-9 | |
ntimes = 1 #number of time you need to print a particular alphabet. Eg. to print 'b' print '2' twice | |
#Make a Dictionary of all patterns and store it in 'key_pad'. | |
#Eg: key_pad['b'] = '22' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
__author__ = "Deepak.G.R." | |
__license__ = 'Public Domain' | |
""" | |
usage: | |
Go to command line and type | |
python ai-class.py "topic-name" |