Example #1
0
def main() :
    for index in range(0, grid.NUM_OF_VESSELS) :
        human.get_location(index)
        t00_0_ai.get_location(index)

#    t00_0_ai.attack_grid.drop_test_bombs()
#    human.attack_grid.drop_test_bombs()

    while (not has_winner()) :
        # user's turn
        row, column = human.get_choice()
        if (t00_0_ai.defend_grid.is_hit(row, column)) :
            print("HIT!!")
        else :
            print("You missed.")
        t00_0_ai.defend_grid.drop_bomb(human.attack_grid, row, column)
        print()

        #ai's turn
        row, column = t00_0_ai.get_choice()
        if (human.defend_grid.is_hit(row, column)) :
            print("You've been hit.")
        else :
            print("I missed.")
        human.defend_grid.drop_bomb(t00_0_ai.attack_grid, row, column)
        human.defend_grid.print_grid()

    announce_winner()
Example #2
0
def main():

    # prints VESSEL_NAME[index], location, and orientation of a vessel
    print_titlescreen()
    grid.print_grid()
    # Ask user to place all 5 ships
    i = 0
    for i in range(5):  # for loop
        human.get_location(i)
        grid.print_grid()
        ai.get_location(i)
        grid.print_grid()

    enter_choice()
    return
Example #3
0
def main() :
    human.info()
    
    human.get_location(0)
    for num in range(1, grid.NUM_OF_VESSELS) :
        human.get_location(num)
        
    print("====================================")    
    print("The AI's grid will now be displayed.")
    print("====================================")
        
    t09_2_ai.get_location(0)
    for num in range(1, grid.NUM_OF_VESSELS) :
        t09_2_ai.get_location(num)
    human.enter_choice()
def main():
        
    # prints VESSEL_NAME[index], location, and orientation of a vessel
	print_titlescreen()
	grid.print_grid()
    # Ask user to place all 5 ships
	i = 0
	for i in range(5): # for loop
		human.get_location(i)
		grid.print_grid()
		ai.get_location(i)
		grid.print_grid()
		
	enter_choice()
	return