A&M Soccer Forum - Rule #1 2.0 edition

689,194 Views | 6442 Replies | Last: 5 hrs ago by aggiephoenix02
jeffk
How long do you want to ignore this user?
AG
Btw, our opponent has a 5-star RB who's committed to Alabama.
mAgnoliAg
How long do you want to ignore this user?
AG
Do you coach for Scarborough?
jeffk
How long do you want to ignore this user?
AG
Shhhh... that's a rule #1 secret.
mid90
How long do you want to ignore this user?
AG
quote:
Btw, our opponent has a 5-star RB who's committed to Alabama.
T&Ps m8
jeffk
How long do you want to ignore this user?
CDub06
How long do you want to ignore this user?
AG
Way to cover the spread. Onto soccer season!
jeffk
How long do you want to ignore this user?
mid90
How long do you want to ignore this user?
AG
I'm going to the game today! Keeping alive my streak of going to at least one game at Kyle Field a year since I was a freshman. Today makes it 7 years!
CDub06
How long do you want to ignore this user?
AG
Oh. That's....neat.
Pro Sandy
How long do you want to ignore this user?
AG
I've gone at least once a decade since 1999. I'm good until 2029. It may take that long to save up enough for a ticket
Pro Sandy
How long do you want to ignore this user?
AG
Bad week in pick em...
Pro Sandy
How long do you want to ignore this user?
AG
I forgot to place my bets until about 3PM, so I just took the last games and spread my money across them. My breakdown

Utah
BYU
LA Laffy
Georgia
Texas State
Okay State
Texas Aggies
South Florida
LSU
Michigan State
FSU
Boise State
Arizona State
CDub06
How long do you want to ignore this user?
AG
I nailed the Notre Dame upset. But I only put $1 on it as a reminder to go back and check the odds today and adjust my wager. I forgot... Still got that upset though.
mid90
How long do you want to ignore this user?
AG
I completely forgot to make any picks. Which probably worked in my favor as yesterday was a huge wtf across college football.
Pro Sandy
How long do you want to ignore this user?
AG
Had I just completely forgotten, I would have been better off.
GigemNick
How long do you want to ignore this user?
AG
40000 on Auburn.
100000 on Texas Aggies.
70000 on LSU.

I think I'm done for.
Pro Sandy
How long do you want to ignore this user?
AG
quote:
I nailed the Notre Dame upset. But I only put $1 on it as a reminder to go back and check the odds today and adjust my wager. I forgot... Still got that upset though.
What you going to do with your $7?
CDub06
How long do you want to ignore this user?
AG
quote:
quote:
I nailed the Notre Dame upset. But I only put $1 on it as a reminder to go back and check the odds today and adjust my wager. I forgot... Still got that upset though.
What you going to do with your $7?


Let it ride.
Pro Sandy
How long do you want to ignore this user?
AG
Person 1: Hi, what do you do for a living?

Person 2: Absolutely nothing.

Person 1: Oh, so you must run the Texags pickem contest
mid90
How long do you want to ignore this user?
AG
quote:
Person 1: Hi, what do you do for a living?

Person 2: Absolutely nothing.

Person 1: Oh, so you must run the Texags pickem contest
Pro Sandy
How long do you want to ignore this user?
AG
well, except for cdub, we can all say "glad that week is over".

redd, let me know if you need some cash to pay rent...
CDub06
How long do you want to ignore this user?
AG
Are you kidding me? I went down from 55th overall to 57th overall. What a miserable week.
Pro Sandy
How long do you want to ignore this user?
AG
Here is the graph.



Most interesting item, we had to adjust the vertical axis so that redd was still on the graph. The poor man lost everything this week. Pass the hat for the man so he can get some chicken.

Everyone fell this week in the overall, some more than others, except mid90 who did not bet at all. CDub remains our leader in 57th place.

Combined we (cdub) made $14,254. Combined we (everyone else except mid) lost $421,251.

Next week, let's dominate. Who's with me?
mid90
How long do you want to ignore this user?
AG
Now I'm ahead of two people, maybe Nick too (can't tell...). I should not bet more often
CDub06
How long do you want to ignore this user?
AG
I continue to bet on Thursday games even though I lose every week and start the weekend in the red...
Pro Sandy
How long do you want to ignore this user?
AG
quote:
Now I'm ahead of two people, maybe Nick too (can't tell...). I should not bet more often
Nope, Nick is still ahead of you by 1 position. You are #1082, he is #1081. His $257 more deserves respect.
Pro Sandy
How long do you want to ignore this user?
AG
The only money bet right now is mine.
CDub06
How long do you want to ignore this user?
AG
I have 96 scans on my Freebirds card.
jeffk
How long do you want to ignore this user?
AG
Fatty.
mid90
How long do you want to ignore this user?
AG
Python is awesome. Wish I would have learned it sooner.
Pro Sandy
How long do you want to ignore this user?
AG
#ticTacToe.py
#pro sandy
#Python 3, ver: 3.3.2
#Wing IDE 101, ver: 5.0.1-1 (rev 30370)
#This is a simple Tic Tac Toe game with only command line interface. It operates
#both 1 and 2 player. For 1 player, the computer opponent has three difficulty
#levels, easy, medium, and hard.
#
#For easy level, the computer picks his next move at random.
#
#For medium level, the computer checks first for the possibility for him to win,
#then checks for the ability to block the opponent from winning.
#
#For hard level, the computer implements the perfect game strategy.
#
################################################################################
#Edit Log
#Created February 21, 2014
#
#February 23, 2014 - added medium level. The algorithm is designed to first for
#attempt for the ability to win in 1 move. If not possible, it attempts to block
#the user from winning in 1 move.
#
#March 13, 2014 - began work on hard level, added player names
#
#March 16, 2014 - corrected error in hard level for blocking fork
#
#To add: Other algorithms for computer for harder levels, ask
#for user names, develop graphical interface, add comments, organize layout of
#code
#
################################################################################
#modules
import sys
from random import randrange
from time import sleep
def initialize():

initialBoard = [[" ","|"," ","|"," "],["-","-","-","-","-",],
[" ","|"," ","|"," "], ["-","-","-","-","-",],
[" ","|"," ","|"," "]]
board = list(initialBoard)
return board
def displayBoard(board):
print("\n")
for r in range(0,5,1):
print(board[r][0], board[r][1], board[r][2],
board[r][3], board[r][4])
print("\n")
return
def displayCleanBoard(board):
for i in board:
for item in i:
numbers = ["1","2","3","4","5","6","7","8","9",1,2,3,4,5,6,7,8,9]
if item in numbers:
iIndex = board.index(i)
itemIndex = board[iIndex].index(item)
board[iIndex][itemIndex] = " "
displayBoard(board)
return
def getNames(typeGame):
names = ["",""]
if typeGame == "single":
names[0] = input("\nWhat is your name? ")
elif typeGame == "double":
names[0] = input("\nPlayer 1, enter your name: ")
names[1] = input("\nPlayer 2, enter your name: ")
return names
def whosFirst():
return randrange(0,2,1) #Computer is user 1
def checkCat(board):
CAT = False
if len(spacesAvailableTracker(board)) == 0:
CAT = True
return CAT
def catEnd(board):
displayBoard(board)
print("\nSorry, scratch this one up for Cat.")
return
def checkWinner(board):
winner = False
if board[0][0] == board[0][2] == board[0][4] == "X":
winner = True
if board[2][0] == board[2][2] == board[2][4] == "X":
winner = True
if board[4][0] == board[4][2] == board[4][4] == "X":
winner = True
if board[0][0] == board[2][0] == board[4][0] == "X":
winner = True
if board[0][2] == board[2][2] == board[4][2] == "X":
winner = True
if board[0][4] == board[2][4] == board[4][4] == "X":
winner = True
if board[0][0] == board[2][2] == board[4][4] == "X":
winner = True
if board[0][4] == board[2][2] == board[4][0] == "X":
winner = True
if board[0][0] == board[0][2] == board[0][4] == "O":
winner = True
if board[2][0] == board[2][2] == board[2][4] == "O":
winner = True
if board[4][0] == board[4][2] == board[4][4] == "O":
winner = True
if board[0][0] == board[2][0] == board[4][0] == "O":
winner = True
if board[0][2] == board[2][2] == board[4][2] == "O":
winner = True
if board[0][4] == board[2][4] == board[4][4] == "O":
winner = True
if board[0][0] == board[2][2] == board[4][4] == "O":
winner = True
if board[0][4] == board[2][2] == board[4][0] == "O":
winner = True
return winner
def winnerEnd(typePlay, board, winner, playerNames):
if typePlay == "single":
if winner == 0:
print("Sorry, %s. The computer one this round" % playerNames[0])
else:
print("Tic Tac Toe! Three in a row!\nCongratulations! You won, %s\n!" %playerNames[0])
else:
if winner == 0:
print("Tic Tac Toe! Three in a row!\n%s wins! Congratulations!\n" %playerNames[0])
else:
print("Tic Tac Toe! Three in a row!\n%s wins! Congratulations!\n" %playerNames[1])
return
def spacesAvailableTracker(board):
spacesAvailable = []
XO = ["X","O"]
if board[0][0] not in XO:
spacesAvailable.append(0)
if board[0][2] not in XO:
spacesAvailable.append(1)
if board[0][4] not in XO:
spacesAvailable.append(2)
if board[2][0] not in XO:
spacesAvailable.append(3)
if board[2][2] not in XO:
spacesAvailable.append(4)
if board[2][4] not in XO:
spacesAvailable.append(5)
if board[4][0] not in XO:
spacesAvailable.append(6)
if board[4][2] not in XO:
spacesAvailable.append(7)
if board[4][4] not in XO:
spacesAvailable.append(8)
return spacesAvailable
def userMakeMove(board, userToken, typePlay, playerID, names):
spacesAvailable = spacesAvailableTracker(board)
for item in spacesAvailable:
if item == 0:
board[0][0] = 1
elif item == 1:
board[0][2] = 2
elif item == 2:
board[0][4] = 3
elif item == 3:
board[2][0] = 4
elif item == 4:
board[2][2] = 5
elif item == 5:
board[2][4] = 6
elif item == 6:
board[4][0] = 7
elif item == 7:
board[4][2] = 8
elif item == 8:
board[4][4] = 9
else:
print("Unexpected Error. spacesAvailable in userMakeMore out of sync")
sys.exit()
inputNotValid = True
while inputNotValid:
displayBoard(board)
if typePlay == "single":
userMoveChoice = input("Make your move! Choose a square from the board.\nSquare Number: ")
else:
if playerID == 1:
userMoveChoice = input("%s, make your move! Choose a square from the board.\nSquare Number: " % names[0])
else:
userMoveChoice = input("%s, make your move! Choose a square from the board.\nSquare Number: " % names[1])
try:
userMoveChoice = int(userMoveChoice)
except ValueError:
print("\nSorry, invalid input.\n")
if userMoveChoice-1 not in spacesAvailable:
print("\nSorry, invalid input.\n")
else:
inputNotValid = False
if userMoveChoice == 1:
row = 0
column = 0
elif userMoveChoice == 2:
row = 0
column = 2
elif userMoveChoice == 3:
row = 0
column = 4
elif userMoveChoice == 4:
row = 2
column = 0
elif userMoveChoice == 5:
row = 2
column = 2
elif userMoveChoice == 6:
row = 2
column = 4
elif userMoveChoice == 7:
row = 4
column = 0
elif userMoveChoice == 8:
row = 4
column = 2
elif userMoveChoice == 9:
row = 4
column = 4
else:
print("Error. userMoveChoice passed while not between 1-9.")
sys.exit()
board[row][column] = userToken
displayCleanBoard(board)
return board
def easyComp(spacesAvailable):
pick = randrange(0,len(spacesAvailable),1)
return pick
def mediumComp(board, spacesAvailable, compToken):
if compToken == "X":
notCompToken = "O"
else:
notCompToken = "X"
if board[0][0] == board[0][2] == notCompToken and spacesAvailable.count(2) != 0:
pick = spacesAvailable.index(2)
elif board[0][0] == board[0][4] == notCompToken and spacesAvailable.count(1) != 0:
pick = spacesAvailable.index(1)
elif board[0][2] == board[0][4] == notCompToken and spacesAvailable.count(0) != 0:
pick = spacesAvailable.index(0)
elif board[2][0] == board[2][2] == notCompToken and spacesAvailable.count(5) != 0:
pick = spacesAvailable.index(5)
elif board[2][0] == board[2][4] == notCompToken and spacesAvailable.count(4) != 0:
pick = spacesAvailable.index(4)
elif board[2][2] == board[2][4] == notCompToken and spacesAvailable.count(3) != 0:
pick = spacesAvailable.index(3)
elif board[4][0] == board[4][2] == notCompToken and spacesAvailable.count(8) != 0:
pick = spacesAvailable.index(8)
elif board[4][0] == board[4][4] == notCompToken and spacesAvailable.count(7) != 0:
pick = spacesAvailable.index(7)
elif board[4][2] == board[4][4] == notCompToken and spacesAvailable.count(6) != 0:
pick = spacesAvailable.index(6)
elif board[0][0] == board[2][0] == notCompToken and spacesAvailable.count(6) != 0:
pick = spacesAvailable.index(6)
elif board[0][0] == board[4][0] == notCompToken and spacesAvailable.count(3) != 0:
pick = spacesAvailable.index(3)
elif board[2][0] == board[4][0] == notCompToken and spacesAvailable.count(0) != 0:
pick = spacesAvailable.index(0)
elif board[0][2] == board[2][2] == notCompToken and spacesAvailable.count(7) != 0:
pick = spacesAvailable.index(7)
elif board[0][2] == board[4][2] == notCompToken and spacesAvailable.count(4) != 0:
pick = spacesAvailable.index(4)
elif board[2][2] == board[4][2] == notCompToken and spacesAvailable.count(1) != 0:
pick = spacesAvailable.index(1)
elif board[0][4] == board[2][4] == notCompToken and spacesAvailable.count(8) != 0:
pick = spacesAvailable.index(8)
elif board[0][4] == board[4][4] == notCompToken and spacesAvailable.count(5) != 0:
pick = spacesAvailable.index(5)
elif board[2][4] == board[4][4] == notCompToken and spacesAvailable.count(2) != 0:
pick = spacesAvailable.index(2)
elif board[0][0] == board[4][4] == notCompToken and spacesAvailable.count(4) != 0:
pick = spacesAvailable.index(4)
elif board[0][0] == board[2][2] == notCompToken and spacesAvailable.count(8) != 0:
pick = spacesAvailable.index(8)
elif board[2][2] == board[4][4] == notCompToken and spacesAvailable.count(0) != 0:
pick = spacesAvailable.index(0)
elif board[0][4] == board[4][0] == notCompToken and spacesAvailable.count(4) != 0:
pick = spacesAvailable.index(4)
elif board[0][4] == board[2][2] == notCompToken and spacesAvailable.count(6) != 0:
pick = spacesAvailable.index(6)
elif board[2][2] == board[4][0] == notCompToken and spacesAvailable.count(2) != 0:
pick = spacesAvailable.index(2)
else:
pick = randrange(0,len(spacesAvailable),1)
if board[0][0] == board[0][2] == compToken and spacesAvailable.count(2) != 0:
pick = spacesAvailable.index(2)
elif board[0][0] == board[0][4] == compToken and spacesAvailable.count(1) != 0:
pick = spacesAvailable.index(1)
elif board[0][2] == board[0][4] == compToken and spacesAvailable.count(0) != 0:
pick = spacesAvailable.index(0)
elif board[2][0] == board[2][2] == compToken and spacesAvailable.count(5) != 0:
pick = spacesAvailable.index(5)
elif board[2][0] == board[2][4] == compToken and spacesAvailable.count(4) != 0:
pick = spacesAvailable.index(4)
elif board[2][2] == board[2][4] == compToken and spacesAvailable.count(3) != 0:
pick = spacesAvailable.index(3)
elif board[4][0] == board[4][2] == compToken and spacesAvailable.count(8) != 0:
pick = spacesAvailable.index(8)
elif board[4][0] == board[4][4] == compToken and spacesAvailable.count(7) != 0:
pick = spacesAvailable.index(7)
elif board[4][2] == board[4][4] == compToken and spacesAvailable.count(6) != 0:
pick = spacesAvailable.index(6)
elif board[0][0] == board[2][0] == compToken and spacesAvailable.count(6) != 0:
pick = spacesAvailable.index(6)
elif board[0][0] == board[4][0] == compToken and spacesAvailable.count(3) != 0:
pick = spacesAvailable.index(3)
elif board[2][0] == board[4][0] == compToken and spacesAvailable.count(0) != 0:
pick = spacesAvailable.index(0)
elif board[0][2] == board[2][2] == compToken and spacesAvailable.count(7) != 0:
pick = spacesAvailable.index(7)
elif board[0][2] == board[4][2] == compToken and spacesAvailable.count(4) != 0:
pick = spacesAvailable.index(4)
elif board[2][2] == board[4][2] == compToken and spacesAvailable.count(1) != 0:
pick = spacesAvailable.index(1)
elif board[0][4] == board[2][4] == compToken and spacesAvailable.count(8) != 0:
pick = spacesAvailable.index(8)
elif board[0][4] == board[4][4] == compToken and spacesAvailable.count(5) != 0:
pick = spacesAvailable.index(5)
elif board[2][4] == board[4][4] == compToken and spacesAvailable.count(2) != 0:
pick = spacesAvailable.index(2)
elif board[0][0] == board[4][4] == compToken and spacesAvailable.count(4) != 0:
pick = spacesAvailable.index(4)
elif board[0][0] == board[2][2] == compToken and spacesAvailable.count(8) != 0:
pick = spacesAvailable.index(8)
elif board[2][2] == board[4][4] == compToken and spacesAvailable.count(0) != 0:
pick = spacesAvailable.index(0)
elif board[0][4] == board[4][0] == compToken and spacesAvailable.count(4) != 0:
pick = spacesAvailable.index(4)
elif board[0][4] == board[2][2] == compToken and spacesAvailable.count(6) != 0:
pick = spacesAvailable.index(6)
elif board[2][2] == board[4][0] == compToken and spacesAvailable.count(2) != 0:
pick = spacesAvailable.index(2)
else:
pass
return pick
def hardComp(board, spacesAvailable, compToken):
if compToken == "X":
notCompToken = "O"
else:
notCompToken = "X"

#initialize with random, ensures a choice is always made.
pick = randrange(0,len(spacesAvailable),1)

#take empty side
emptySide = []
if 1 in spacesAvailable:
emptySide.append(1)
if 3 in spacesAvailable:
emptySide.append(3)
if 5 in spacesAvailable:
emptySide.append(5)
if 7 in spacesAvailable:
emptySide.append(7)
if len(emptySide) > 0:
pick = spacesAvailable.index(emptySide[randrange(0,len(emptySide),1)])

#take empty corner
emptyCorner = []
if 0 in spacesAvailable:
emptyCorner.append(0)
if 2 in spacesAvailable:
emptyCorner.append(2)
if 6 in spacesAvailable:
emptyCorner.append(6)
if 8 in spacesAvailable:
emptyCorner.append(8)
if len(emptyCorner) > 0:
pick = spacesAvailable.index(emptyCorner[randrange(0,len(emptyCorner),1)])

#take empty opposite corner
emptyOppositeCorner = []
if board[0][0] == notCompToken and spacesAvailable.count(8) != 0:
emptyOppositeCorner.append(8)
if board[0][4] == notCompToken and spacesAvailable.count(6) != 0:
emptyOppositeCorner.append(6)
if board[4][0] == notCompToken and spacesAvailable.count(2) != 0:
emptyOppositeCorner.append(2)
if board[4][4] == notCompToken and spacesAvailable.count(0) != 0:
emptyOppositeCorner.append(0)
if len(emptyOppositeCorner) > 0:
pick = spacesAvailable.index(emptyOppositeCorner[randrange(0,len(emptyOppositeCorner),1)])

#take center
if 4 in spacesAvailable:
pick = spacesAvailable.index(4)

#block fork
if board[0][0] == board[4][4] == notCompToken and board[2][2] == compToken:
emptySide = []
if 1 in spacesAvailable:
emptySide.append(1)
if 3 in spacesAvailable:
emptySide.append(3)
if 5 in spacesAvailable:
emptySide.append(5)
if 7 in spacesAvailable:
emptySide.append(7)
if len(emptySide) > 0:
pick = spacesAvailable.index(emptySide[randrange(0,len(emptySide),1)])
if board[0][4] == board[4][0] == notCompToken and board[2][2] == compToken:
emptySide = []
if 1 in spacesAvailable:
emptySide.append(1)
if 3 in spacesAvailable:
emptySide.append(3)
if 5 in spacesAvailable:
emptySide.append(5)
if 7 in spacesAvailable:
emptySide.append(7)
if len(emptySide) > 0:
pick = spacesAvailable.index(emptySide[randrange(0,len(emptySide),1)])


if board[0][0] == board[2][2] == notCompToken and board[4][4] == compToken:
emptyCorner = []
if 2 in spacesAvailable:
emptyCorner.append(2)
if 6 in spacesAvailable:
emptyCorner.append(6)
if len(emptyCorner) > 0:
pick = spacesAvailable.index(emptyCorner[randrange(0,len(emptyCorner),1)])
if board[0][4] == board[2][2] == notCompToken and board[4][0] == compToken:
emptyCorner = []
if 0 in spacesAvailable:
emptyCorner.append(0)
if 8 in spacesAvailable:
emptyCorner.append(8)
if len(emptyCorner) > 0:
pick = spacesAvailable.index(emptyCorner[randrange(0,len(emptyCorner),1)])
print(pick)
if board[4][0] == board[2][2] == notCompToken and board[0][4] == compToken:
emptyCorner = []
if 0 in spacesAvailable:
emptyCorner.append(0)
if 8 in spacesAvailable:
emptyCorner.append(8)
if len(emptyCorner) > 0:
pick = spacesAvailable.index(emptyCorner[randrange(0,len(emptyCorner),1)])
if board[4][4] == board[2][2] == notCompToken and board[0][0] == compToken:
emptyCorner = []
if 2 in spacesAvailable:
emptyCorner.append(2)
if 6 in spacesAvailable:
emptyCorner.append(6)
if len(emptyCorner) > 0:
pick = spacesAvailable.index(emptyCorner[randrange(0,len(emptyCorner),1)])



#fork



#block
if board[0][0] == board[0][2] == notCompToken and spacesAvailable.count(2) != 0:
pick = spacesAvailable.index(2)
elif board[0][0] == board[0][4] == notCompToken and spacesAvailable.count(1) != 0:
pick = spacesAvailable.index(1)
elif board[0][2] == board[0][4] == notCompToken and spacesAvailable.count(0) != 0:
pick = spacesAvailable.index(0)
elif board[2][0] == board[2][2] == notCompToken and spacesAvailable.count(5) != 0:
pick = spacesAvailable.index(5)
elif board[2][0] == board[2][4] == notCompToken and spacesAvailable.count(4) != 0:
pick = spacesAvailable.index(4)
elif board[2][2] == board[2][4] == notCompToken and spacesAvailable.count(3) != 0:
pick = spacesAvailable.index(3)
elif board[4][0] == board[4][2] == notCompToken and spacesAvailable.count(8) != 0:
pick = spacesAvailable.index(8)
elif board[4][0] == board[4][4] == notCompToken and spacesAvailable.count(7) != 0:
pick = spacesAvailable.index(7)
elif board[4][2] == board[4][4] == notCompToken and spacesAvailable.count(6) != 0:
pick = spacesAvailable.index(6)
elif board[0][0] == board[2][0] == notCompToken and spacesAvailable.count(6) != 0:
pick = spacesAvailable.index(6)
elif board[0][0] == board[4][0] == notCompToken and spacesAvailable.count(3) != 0:
pick = spacesAvailable.index(3)
elif board[2][0] == board[4][0] == notCompToken and spacesAvailable.count(0) != 0:
pick = spacesAvailable.index(0)
elif board[0][2] == board[2][2] == notCompToken and spacesAvailable.count(7) != 0:
pick = spacesAvailable.index(7)
elif board[0][2] == board[4][2] == notCompToken and spacesAvailable.count(4) != 0:
pick = spacesAvailable.index(4)
elif board[2][2] == board[4][2] == notCompToken and spacesAvailable.count(1) != 0:
pick = spacesAvailable.index(1)
elif board[0][4] == board[2][4] == notCompToken and spacesAvailable.count(8) != 0:
pick = spacesAvailable.index(8)
elif board[0][4] == board[4][4] == notCompToken and spacesAvailable.count(5) != 0:
pick = spacesAvailable.index(5)
elif board[2][4] == board[4][4] == notCompToken and spacesAvailable.count(2) != 0:
pick = spacesAvailable.index(2)
elif board[0][0] == board[4][4] == notCompToken and spacesAvailable.count(4) != 0:
pick = spacesAvailable.index(4)
elif board[0][0] == board[2][2] == notCompToken and spacesAvailable.count(8) != 0:
pick = spacesAvailable.index(8)
elif board[2][2] == board[4][4] == notCompToken and spacesAvailable.count(0) != 0:
pick = spacesAvailable.index(0)
elif board[0][4] == board[4][0] == notCompToken and spacesAvailable.count(4) != 0:
pick = spacesAvailable.index(4)
elif board[0][4] == board[2][2] == notCompToken and spacesAvailable.count(6) != 0:
pick = spacesAvailable.index(6)
elif board[2][2] == board[0][4] == notCompToken and spacesAvailable.count(2) != 0:
pick = spacesAvailable.index(2)
else:
pass
if board[0][0] == board[0][2] == compToken and spacesAvailable.count(2) != 0:
pick = spacesAvailable.index(2)
elif board[0][0] == board[0][4] == compToken and spacesAvailable.count(1) != 0:
pick = spacesAvailable.index(1)
elif board[0][2] == board[0][4] == compToken and spacesAvailable.count(0) != 0:
pick = spacesAvailable.index(0)
elif board[2][0] == board[2][2] == compToken and spacesAvailable.count(5) != 0:
pick = spacesAvailable.index(5)
elif board[2][0] == board[2][4] == compToken and spacesAvailable.count(4) != 0:
pick = spacesAvailable.index(4)
elif board[2][2] == board[2][4] == compToken and spacesAvailable.count(3) != 0:
pick = spacesAvailable.index(3)
elif board[4][0] == board[4][2] == compToken and spacesAvailable.count(8) != 0:
pick = spacesAvailable.index(8)
elif board[4][0] == board[4][4] == compToken and spacesAvailable.count(7) != 0:
pick = spacesAvailable.index(7)
elif board[4][2] == board[4][4] == compToken and spacesAvailable.count(6) != 0:
pick = spacesAvailable.index(6)
elif board[0][0] == board[2][0] == compToken and spacesAvailable.count(6) != 0:
pick = spacesAvailable.index(6)
elif board[0][0] == board[4][0] == compToken and spacesAvailable.count(3) != 0:
pick = spacesAvailable.index(3)
elif board[2][0] == board[4][0] == compToken and spacesAvailable.count(0) != 0:
pick = spacesAvailable.index(0)
elif board[0][2] == board[2][2] == compToken and spacesAvailable.count(7) != 0:
pick = spacesAvailable.index(7)
elif board[0][2] == board[4][2] == compToken and spacesAvailable.count(4) != 0:
pick = spacesAvailable.index(4)
elif board[2][2] == board[4][2] == compToken and spacesAvailable.count(1) != 0:
pick = spacesAvailable.index(1)
elif board[0][4] == board[2][4] == compToken and spacesAvailable.count(8) != 0:
pick = spacesAvailable.index(8)
elif board[0][4] == board[4][4] == compToken and spacesAvailable.count(5) != 0:
pick = spacesAvailable.index(5)
elif board[2][4] == board[4][4] == compToken and spacesAvailable.count(2) != 0:
pick = spacesAvailable.index(2)
elif board[0][0] == board[4][4] == compToken and spacesAvailable.count(4) != 0:
pick = spacesAvailable.index(4)
elif board[0][0] == board[2][2] == compToken and spacesAvailable.count(8) != 0:
pick = spacesAvailable.index(8)
elif board[2][2] == board[4][4] == compToken and spacesAvailable.count(0) != 0:
pick = spacesAvailable.index(0)
elif board[0][4] == board[4][0] == compToken and spacesAvailable.count(4) != 0:
pick = spacesAvailable.index(4)
elif board[0][4] == board[2][2] == compToken and spacesAvailable.count(6) != 0:
pick = spacesAvailable.index(6)
elif board[2][2] == board[4][0] == compToken and spacesAvailable.count(2) != 0:
pick = spacesAvailable.index(2)
else:
pass
return pick
def compMakeMove(board, compToken, level):
print("\nPlease wait while the computer moves.")
sleep(3)
blankList = []
spacesAvailable = spacesAvailableTracker(board)
if level == "easy":
pick = easyComp(spacesAvailable)
elif level == "medium":
pick = mediumComp(board, spacesAvailable, compToken)
elif level == "hard":
pick = hardComp(board, spacesAvailable, compToken)
else:
print("Error, level not passed in compMakeMove")
sys.exit()
if spacesAvailable[pick] == 0:
row = 0
column = 0
elif spacesAvailable[pick] == 1:
row = 0
column = 2
elif spacesAvailable[pick] == 2:
row = 0
column = 4
elif spacesAvailable[pick] == 3:
row = 2
column = 0
elif spacesAvailable[pick] == 4:
row = 2
column = 2
elif spacesAvailable[pick] == 5:
row = 2
column = 4
elif spacesAvailable[pick] == 6:
row = 4
column = 0
elif spacesAvailable[pick] == 7:
row = 4
column = 2
elif spacesAvailable[pick] == 8:
row = 4
column = 4
else:
print("Error in compMakeMove. pick outside range 0-8.")
sys.exit()
board[row][column] = compToken
displayCleanBoard(board)
sleep(1)
return board


def singleIntro():
print("\nSingle Player Tic Tac Toe play\n")
sleep(1)
level = pickLevel()
pNames = getNames("single")
print("\nWho starts will be chosen by random.\n")
first = whosFirst()
if first == 0:
compToken = "X"
userToken = "O"
print("The computer will be first.\nHe will be X, you will be O.")
else:
userToken = "X"
compToken = "O"
print("You will be first.\nYou will be X, The computer will be O.")
nextMove = first
return compToken, userToken, nextMove, level, pNames
def doubleIntro():
pNames = getNames("double")
print("Two Player Tic Tac Toe play\n\nWho starts will be chosen by random.\n")
sleep(2)

first = whosFirst()

if first == 0:
compToken = "X"
userToken = "O"
print("%s will be first.\n%s will be X, %s will be O." % (pNames[0], pNames[0], pNames[1]))
else:
userToken = "X"
compToken = "O"
print("%s will be first.\n%s will be X, %s will be O." % (pNames[1], pNames[1], pNames[0]))
nextMove = first
return compToken, userToken, nextMove, pNames
def pickLevel():
easyChoices = ["e", "easy"]
mediumChoices = ["m", "medium"]
hardChoices = ["h", "hard"]
choices = easyChoices + mediumChoices + hardChoices
inputNotValid = True
while inputNotValid:
level = input("What level do you want to play? (easy, medium, hard): ")
if level.lower() not in choices:
print("Sorry, invalid input.")
else:
inputNotValid = False
if level.lower() in easyChoices:
level = "easy"
elif level.lower() in mediumChoices:
level = "medium"
elif level.lower() in hardChoices:
level = "hard"
else:
print("Error in pickLevel. level passed not in choices.")
sys.exit()
return level.lower()
def playAgain():
YES = ["YES", "Y"]
NO = ["NO", "N"]
YNOPTIONS = YES + NO
nonvalidInput = True
while nonvalidInput:
repeat = input("Would you like to play again? ")
if repeat.upper() in YNOPTIONS:
nonvalidInput = False
if repeat.upper() in YES:
return True
else:
return False
else:
print("Sorry, input not valid.")

def singlePlayerGameConsole():
currentBoard = initialize()
spacesAvailableTracker(currentBoard)
computerToken, userToken, nextMove, level, names = singleIntro()
noWinner = True
while noWinner:
if nextMove == 0:
currentBoard = compMakeMove(currentBoard, computerToken, level)
winner = checkWinner(currentBoard)
else:
currentBoard = userMakeMove(currentBoard, userToken, "single", "", names)
winner = checkWinner(currentBoard)
if winner:
winnerEnd("single", currentBoard, nextMove, names)
noWinner = False
if checkCat(currentBoard):
catEnd(currentBoard)
noWinner = False
nextMove += 1
nextMove %= 2

def twoPlayerGameConsole():
currentBoard = initialize()
spacesAvailableTracker(currentBoard)
user1Token, user2Token, nextMove, names = doubleIntro()
noWinner = True
while noWinner:
if nextMove == 0:
currentBoard = userMakeMove(currentBoard, user1Token, "double",
nextMove + 1, names)
winner = checkWinner(currentBoard)
else:
currentBoard = userMakeMove(currentBoard, user2Token, "double",
nextMove + 1, names)
winner = checkWinner(currentBoard)
if winner:
winnerEnd("double",currentBoard, nextMove, names)
noWinner = False
if checkCat(currentBoard):
catEnd(currentBoard)
noWinner = False
nextMove += 1
nextMove %= 2


def gameConsole():
singleOption = ["1","S","SINGLE","ONE","O"]
doubleOption = ["2","D","DOUBLE","TWO","T"]
typeOptions = singleOption + doubleOption
try:
print("Welcome to Tic-Tac-Toe!\n3 in a row wins.\n")
again = True
while(again):

inputNotValid = True #variable used to control while loop
while inputNotValid:
playType = input("1 or 2 players? ")
if playType not in typeOptions:
print("Sorry, input not valid.")
else:
inputNotValid = False
if playType in singleOption:
singlePlayerGameConsole()
else:
twoPlayerGameConsole()

again = playAgain()

if again:
print("\nStarting a new game.\n")
else:
print("\nThanks for playing!")
sys.exit()

except SystemExit:
print("Program terminated.")
except KeyboardInterrupt:
print("\nKeyboardInterrupt. Program terminated.")
except:
print("Unexpected error. %s Program terminated." % sys.exc_info()[0])
#main
if __name__ == "__main__":
gameConsole()
Pro Sandy
How long do you want to ignore this user?
AG
My favorite one though. too bad texags deletes white space.


#ohSnap.py
#pro sandy
#Python 3, ver: 3.3.2
#Wing IDE 101, 5.0.1-1 (rev 30370)
#Program determines if an "Oh, snap!" is appropriately warranted.
def ohSnap():
YES = ["YES", "Y"]
NO = ["NO", "N"]
YNOPTIONS = YES + NO

while True:
toldCheck = input("Did someone get told? ")
if toldCheck.upper() in YNOPTIONS:
if toldCheck.upper() in YES:
print("Oh, snap!\n")
break
else:
print("Tell them.\n")

else:
print("Invalid input. You got told.\n")

#__main__
if __name__ == "__main__":
ohSnap()
jeffk
How long do you want to ignore this user?
AG
tl;dr
mid90
How long do you want to ignore this user?
AG
So much code
CDub06
How long do you want to ignore this user?
AG
Since we are all about record breaking sports teams in here:

quote:
MATHIS - An amazing basketball game last night as the Mathis Lady Pirates defeated the Kingsville Lady Brahmas 98-0. That's right, as hard as it is to believe it really happened.

I have been covering high school sports for over 30 years and I can promise you I have never ever seen a final score like this. When i first heard about this last night, I refused to put it on the air because I refused to believe it. But here it is.

This is unheard of for a high school varsity basketball team to get shut out.

The Lady Pirates scored 23 in the first quarter, followed by 24 in the second, 24 in the third, and 27 more in the fourth quarter.

We are checking to see if this is any type of national record. In my opinion it must be. Mathis coach Larry Skinner told me his starters played for about eleven minutes each before emptying the bench. But added all eleven players got in some playing time. We'll take a closer look at what could be a record breaking game on KRIS 6 News at 6pm.

http://www.kristv.com/news/mathis-lady-pirates-beat-kingsville-lady-brahmas-98-0/
(Link Courtesy of GigEmNick)
First Page Last Page
Page 124 of 185
 
×
subscribe Verify your student status
See Subscription Benefits
Trial only available to users who have never subscribed or participated in a previous trial.