Skip to content

Instantly share code, notes, and snippets.

Martin Weigert martinweigert

Block or report user

Report or block martinweigert

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:020abe5e1e40393eb62abc42a8b427a5
import matplotlib.pyplot as plt
import statistics
from collections import Counter
from collections import defaultdict
import requests
import json
import datetime
from wordcloud import WordCloud
import random
@martinweigert
martinweigert / tictactoe.py
Last active Apr 18, 2017
Full TicTacTo game
View tictactoe.py
#kind of a milestone for me, built completely on my own.
#task source: http://www.practicepython.org/exercise/2016/08/03/29-tic-tac-toe-game.html
import sys
def play_again():
global player1_count
global player2_count
user_input = input("Do you want to play again? Type 'y' for yes or any key for no. ")
if user_input.startswith("y"):
@martinweigert
martinweigert / TicTacToe.py
Last active Apr 14, 2017
Tic Tac Toe: Checking whether a player has won, and if so, which one
View TicTacToe.py
#0 means an empty square
#1 means that player 1 put their token in that space.
#2 means that player 2 put their token in that space.
#task: tell me whether anyone has won, and tell me which player won, if any.
#task source http://www.practicepython.org/exercise/2015/11/16/26-check-tic-tac-toe.html
game = [[1, 1, 2],[0, 1, 2],[1, 2, 1]]
winner = ""
You can’t perform that action at this time.