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
import enum | |
class Connectivity(enum.Enum): | |
""" | |
4-connectivity or 8-connectivity | |
""" | |
FOUR = 1 | |
EIGHT = 2 |
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
""" | |
find shortest path in graph via Bellman-Ford | |
Uros Ogrizovic | |
""" | |
import numpy as np | |
import matplotlib.pyplot as plt | |
def get_neighbors_of_node(node, adjacency_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
""" | |
bot that plays blackjack | |
Uros Ogrizovic | |
""" | |
import numpy as np | |
from numpy.random import rand, randint | |
def greedy_policy(q): |
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
""" | |
tic-tac-toe using minimax | |
Uros Ogrizovic | |
""" | |
from time import sleep | |
empty_space_sign = 'E' | |
spaces = [[empty_space_sign, empty_space_sign, empty_space_sign], | |
[empty_space_sign, empty_space_sign, empty_space_sign], |