Skip to content

Instantly share code, notes, and snippets.

View codeboy101's full-sized avatar

Tushar codeboy101

View GitHub Profile
@codeboy101
codeboy101 / footballManage2.py
Created January 13, 2016 12:33
a football manager game made in python 3.5 , level:beginner
import random
import time
my_team_name = input('name your team: ')
opp_team_names = ['ice slayers' , 'crazy cats' , 'red devils' , 'blue walls']
opp_team_name = random.choice(opp_team_names)
print('your match is against {}'.format(opp_team_name))
pass_text = [' gives the ball to ' , ' passes it to ' , ' sharply gives it to ' , ' puts it in the path of ']
defend_text = [' performs a great tackle ' , ' comes up with a meaty tackle ']
shoot_text = [ 'hits the ball ' , ' curls it towards the goal ' , ' shoots ']
nameserver 127.0.0.53
sudo add-apt-repository ppa:embrosyn/cinnamon
sudo apt update && sudo apt install cinnamon
import numpy as np
def qr_decomposition(A):
if A.shape[0] != A.shape[1]:
return -1
U = [0 for i in range(A.shape[0])]
E = U
"""get columns"""
sudo rmmod i2c_hid
sudo modprobe i2c_hid
def smash_yogi(limit):
k = 0
current = 0
line_limit = limit
while line_limit > 0:
# check how many numbers printed vs maximum allowed for printing
if current < line_limit:
# we want all numbers of a sequence on the same line
print(limit+k, end=' ')
current += 1
import numpy as np
def gram_schmidt(vectors):
q1 = vectors[0]/np.linalg.norm(vectors[0])
result = [q1]
for b in vectors[1:]:
comp = b + rm_dupl_projctns(b, result)
result.append(comp/np.linalg.norm(comp))
return np.concatenate(result, axis=1)
import numpy as np
import pandas as pd
def normalize(data):
return data/data.mean()
def predict(x, weights):
hypothesis = np.dot(x, weights)
return hypothesis
from string import ascii_lowercase
code = {
'a':'b', 'b':'c', 'c':'d', 'd':'e', 'e':'f', 'f':'g', 'g': 'h', 'h': 'i', 'i': 'j', 'j': 'k', 'k' : 'l', 'l' : 'm',
'm' :'n', 'n' :'o', 'o': 'p', 'p':'q', 'q' : 'r', 'r': 's', 's': 't', 't' : 'u', 'u':'v', 'v': 'w', 'w':'x',
'x' : 'y', 'y' : 'z', 'z' : 'a', ' ': ' '
}
allowedchars = ascii_lowercase + ' '
def changer(a,b):