Skip to content

Instantly share code, notes, and snippets.

View oknono's full-sized avatar

Kirsten Korevaar oknono

  • Melbourne, Australia
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am oknono on github.
  • I am oknono (https://keybase.io/oknono) on keybase.
  • I have a public key whose fingerprint is 8F14 A50F D9A2 6786 BC8D 70FA 2107 8976 8A9D 0EFF

To claim this, I am signing this object:

@oknono
oknono / Node_DFS
Last active August 29, 2015 14:18
Simple node class to represent a tree and DFS algorithm
#!/usr/bin/env python
# 1. Choose representation for Tree
# A tree consists of nodes. For this purpose a
# node has a name, a value, a parent (or None if root),
# and 0..n children (if 0 then node is leaf)
# A default new node doesn't have parent or children.
# They can be added to an object if these linked nodes have
# been instantiated. In this code, the parents are instantiated
# first and can be added as parents when constructing
""""This script starts a game of tic tac toe on a console where a human player
can play against an AI. The player can choose a token and the computer will
decide who will go first. A player can play as many games as (s)he likes. The
program will keep score"""
from random import randint, shuffle
from time import sleep
from copy import deepcopy
class Board(object):