Beispiel #1
0
	def readFile(self):
		"""This functions reads the game.data file to get the knowledge so far"""
		fileN = open("game.data", "r")
		read_recursion.read_recursion(fileN, self.root)
		fileN.close()
Beispiel #2
0
##################################################################
# Name: testread.py
# purpose: To test the read_recursion
#
# Author: Guillermo Ramos Macias
# Attribution: read recursion was  written by Dr. Nakazawa
##################################################

from Tree import TreeNode
import read_recursion

gameTree = TreeNode()
fileN = open("testData.txt", "r")
read_recursion.read_recursion(fileN, gameTree)


def print_tree(tree):
    if tree == None:
        return
    print tree.item
    print_tree(tree.left)
    print_tree(tree.right)


print_tree(gameTree)
Beispiel #3
0
##################################################################
#Name: testread.py
#purpose: To test the read_recursion
#
#Author: Guillermo Ramos Macias
#Attribution: read recursion was  written by Dr. Nakazawa
##################################################

from Tree import TreeNode
import read_recursion
gameTree = TreeNode()
fileN = open("testData.txt", "r")
read_recursion.read_recursion(fileN, gameTree)


def print_tree(tree):
    if tree == None:
        return
    print tree.item
    print_tree(tree.left)
    print_tree(tree.right)


print_tree(gameTree)
Beispiel #4
0
 def readFile(self):
     """This functions reads the game.data file to get the knowledge so far"""
     fileN = open("game.data", "r")
     read_recursion.read_recursion(fileN, self.root)
     fileN.close()