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 /
Last active Apr 18, 2017
Full TicTacTo game
#kind of a milestone for me, built completely on my own.
#task source:
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 /
Last active Apr 14, 2017
Tic Tac Toe: Checking whether a player has won, and if so, which one
#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
game = [[1, 1, 2],[0, 1, 2],[1, 2, 1]]
winner = ""
You can’t perform that action at this time.