<repo_name>tattletaler/probable-octo-journey<file_sep>/cometname.py
#PROG: ride
"""
ID: vishnui3
LANG: PYTHON2
TASK: test
"""
def cometride():
   cometname,groupname = input('enter a comet name comsisting of letters: ').split(" ")
   cometname.lower()
   groupname.lower()
   l = len(cometname)
   le = len(groupname)
   prod = 1
   prod1=1
   for i in range(l):
       prod=prod * (ord(cometname[i]) - 96)
   for j in range(le):
       prod1=prod1 * (ord(groupname[j]) - 96)
       
   a = prod % 47
   b = prod1 % 47
                     
   if a == b:
       print('GO')
   else:
       print('STAY')
                     
cometride()

    


        
    
        
         
<file_sep>/transformers.py
'''
ID: appuk
LANG: PYTHON3
TASK:  transform
'''
def getPattern(f,N):
	p=[]
	for i in range(N):
		p.append(fin.readline().strip())
	return p

def rotateClockwise(p,N):
	after=[]
	for j in range(N):
		after.append(p[N-1][j])
	for i in range(N-1):
		for j in range(N):
			after[j]+=p[N-2-i][j]
	return after
def verticalReflect(p,N):
	after=[]
	for line in p:
		if N%2==1:
			after.append(line[::-1])
		else:
			after.append(line[int(N/2):N][::-1]+line[0:int(N/2)][::-1])
	return after
fin = open('transform.in','r')
N = int(fin.readline().strip())
before=getPattern(fin,N)
after=getPattern(fin,N)

isSecond=False
temp = before
isRunning=True
while isRunning:
	for rotate in range(3):
		temp=rotateClockwise(temp,N)
		if temp==after:
			if isSecond:
				result = 5
			else:
				result = rotate+1
			isRunning=False
			break
	if not isRunning:
		break
	if isSecond:
		result=7
		break

	temp=before
	temp=verticalReflect(temp,N)
	if temp==after:
		result=4
		break
	isSecond=True
with open('transform.out','w') as fout:
	fout.write(f"{result}\n")

<file_sep>/namenummmmmm.py
'''
ID: appuk
LANG: PYTHON3
TASK:  namenum
'''

def toNum(c):
    if ord(c) < ord('Q'):
        return str((ord(c)-65)//3 + 2)
    else:
        return str((ord(c)-66)//3 + 2)

with open('dict.txt','r') as fin:
    names = fin.read().split('\n')

serials = [''.join(list(map(toNum, name))) for name in names]
with open('socdist2.in','r') as fin:
    serial = fin.read()[:-1]

i = -1
o = ''
while serial in serials[i+1:]:
    i = serials.index(serial,i+1)
    o += names[i] + '\n'

if not o:
    o = 'NONE\n'
with open('socdist2.out','w') as fout:
    fout.write (str(3))
    



serials = [ ''.join(list(map(toNum,name))) for name in names]
    
print('socdist2.out','w') as fout
    fout.write (str '\n)ss
<file_sep>/connect4.py
def just_test():
    print("test ...")

if __name__ == "__main__":
    just_test()

def print_board(board):
    boardString = '\n'
    for col in range(7):
        boardString += str(col) + ' '
    boardString += '\n'
    for row in range(6):
        for col in range(7):
            boardString += board[row][col] + ' '
        boardString += '\n'
    return boardString

def check_line_for_win(board,r,c,dr,dc,piece):
    for i in range(4):
        if board[r+i*dr][c+i*dc] != piece:
            return False
    return True

def check_for_win(board,piece):

    for row in range(6):
        for col in range(4):
            if check_line_for_win(board,row,col,0,1,piece):
                return True
    for row in range(3):
        for col in range(7):
            if check_line_for_win(board,row,col,1,0,piece):
                return True
    for row in range(3):
        for col in range(4):
            if check_line_for_win(board,row,col,1,1,piece):
                return True
    for row in range(3,6):
        for col in range(4):
            if check_line_for_win(board,row,col,-1,1,piece):
                return True
    return False


def play_connect_four():


    playerNames = []
    playerNames.append(input("Player X, enter your name: "))
    playerNames.append(input("Player O, enter your name: "))
    pieces = ['X','O']
    turn = 0
    turns = 0
    boardRow = ['.']*7
    board = []
    for row in range(6):
        board.append(boardRow[:])
    columnHeights = [0]*7


    while turns < 42:
        print(print_board(board))
        legalPlay = False
        while not legalPlay:
            play = input(playerNames[turn]+", you're "+pieces[turn]+". What column do you want to play in? ")
            if not play.isdigit():
                print("That's not a valid column -- please choose again.")
            else:
                play = int(play)
                if play < 0 or play > 6:
                    print("That's not a valid column -- please choose again.")
                elif columnHeights[play] == 6:
                    print("That column is full -- please choose another.")
                else:
                    legalPlay = True

        height = 5-columnHeights[play]
        board[height][play] = pieces[turn]
        columnHeights[play] += 1

        winner = check_for_win(board,pieces[turn])
        if winner:
            print(print_board(board))
            print("Congratulations, "+str(playerNames[turn])+", you won!")
            break
        turn = (turn + 1) % 2
        turns += 1
    if turns == 42:  # tie game
        print(print_board(board))
        print("It's a tie!")

play_connect_four()
<file_sep>/hjh.py
'''
ID:appuk
LANG:PYTHON3
TASK: palsquare
'''
"""
ID: joshjq91
LANG: PYTHON3
TASK: palsquare
Jan 2, 2018
"""
def toBase(n, b):
    l = 0
    result = []
    while n >= b**l:
        l += 1

    for i in reversed(range(l)):
        d = n // (b**i)
        if d < 10:
            d = str(d)
        else:
            d = chr(ord('A')+d-10)
        result.append(d)
        n %= (b**i)

    return ''.join(result)


with open('palsquare.in','r') as fin:
    B = int(fin.readline())

with open('palsquare.out','w') as fout:
    for n in range(1,301):
        #print('n', n, 'bn', toBase(n,B))

        bsq = toBase(n**2, B)
        if bsq[::-1] == bsq:
            bn = toBase(n, B)
            fout.write(bn + ' ' + bsq + '\n')

"""
def bAddOne(s, b):
    s = s[::-1]
    i = 0
    s[0] = str(int(s[0]) + 1)
    while s[i] >= b and i < len(s):
        s[i] = '0'
        s[i+1] = str(int(s[i+1]) + 1)
        i += 1
    if i == len(s):
        s[-1] = '0'
        s =
"""
<file_sep>/gifter greddier.py
#PROG: gift1
"""
ID: vishnui3
LANG: PYTHON2
TASK: gift1
"""
a = open("gift1.in", "r")
b = open('gift1.out',"w")
input = a.read()

output = ""

input = input.split("\n")
p = []
for gifts in range(int(input[0])):
  p.append([input[gifts + 1], 0])


del input[0:int(input[0])+1]
del input[-1]


for peeps in range(int(len(p))):

  giver = input[0]
  paid = input[1].split(" ")
  money = int(paid[0])
  shared = int(paid[1])

  receipients = input[2:2 + shared]

  del input[0:2 + shared]

  if money > 0:
    kept = money % shared
    given = money // shared
  else:
    kept = 0
    given = 0
  #Distributing the monies
  for gifts in range(int(len(p))):
    if p[gifts][0] == giver:
      p[gifts][1] -= (money - kept)
    if p[gifts][0] in receipients:
      p[gifts][1] += given
      
  print (p)
  

for data in range(int(len(p))):
  output += p[data][0] + " " + str(p[data][1]) + "\n"

b.write(output)







<file_sep>/friday the thirteenth.py
#PROG: friday
"""
ID: vishnui3
LANG: PYTHON2
TASK: friday
"""

f = open("friday.in", 'r')
w = open("friday.out", 'w')

#Checks what day of the week is the 13th of each month
def year(occured, date, x):
  

  months = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
  ###
  if date % 400 == 0:
    months[1] = 29
  elif date % 100 != 0 and (date % 100) % 4 == 0:
    months[1] = 29
 # 

  week = x
  for time in range(12):
    week = (week + 13) % 7
    occured[week] += 1
    week = (week + (months[time]-13)) % 7
  return occured, week
#

years = int(f.read())

occur = [0,0,0,0,0,0,0]

start = 1

for time in range(1900, years+ 1900, 1):
  occur, start = year(occur, time, start)

for steps in range(6):
  w.write(str(occur[steps]) + " ")
w.write(str(occur[6]) + "\n")


          
    
        
<file_sep>/milking cows.py
'''
ID: appuk
LANG: PYTHON3
TASK:  milk2
'''

def sortKeyGen(line):
	if line:
		start,end=map(int,line.strip().split(" "))
		return start
fin = open('milk2.in','r')
nCows = int(fin.readline().strip())
times = fin.read().split('\n')
times = list(filter(None, times))
times.sort(key=sortKeyGen)
mStart,mEnd = map(int,times[0].strip().split(" "))

longestC = mEnd-mStart
longestI = 0

for time in times:
	if time:
		start, end = map(int,time.strip().split(" "))

		if start-mEnd >= longestI :
			longestI = start-mEnd

		if mStart<=start and start<=mEnd:
			if mEnd<end:
					mEnd=end
		else:
			if mEnd-mStart > longestC:
					longestC = mEnd-mStart
			mStart,mEnd = start,end

with open('milk2.out','w') as fout:
	fout.write(f"{longestC} {longestI}\n")
<file_sep>/README.md
# probable-octo-journey
i'm a hacker,(i hack fortinite, 2048,cookie clicker minecraft and zombsroyale)
