diff --git a/Computing Pi.py b/Computing Pi.py new file mode 100644 index 0000000..6f6e08c --- /dev/null +++ b/Computing Pi.py @@ -0,0 +1,45 @@ +import time +def calculate_next_square_root(number, square_root): + next_square_root = ((number / square_root) + square_root) / 2 + return next_square_root + +def calculate_square_root(number, digits, add): + square_root = 1 * (10 ** (digits + add)) + next_square_root = calculate_next_square_root(number=number, square_root=square_root) + while (next_square_root != square_root): + square_root = next_square_root + next_square_root = calculate_next_square_root(number=number, square_root=square_root) + return square_root +def calculate_next_pi(a, b, t, digits, add): + next_pi = ((10 ** (digits + add)) * ((a + b) ** 2)) / (4 * t) + return next_pi +digits = int(input('How many digits of pi? ')) +add = digits +a = 10 ** (digits + add) +b = calculate_square_root(number=(10 ** ((digits + add) * 2)) / 2, digits=digits, add=add) +t = (10 ** ((digits + add) * 2)) / 4 +p = 1 +pi = -1 +n = 0 +next_pi = calculate_next_pi(a=a, b=b, t=t, digits=digits, add=add) +while True: + try: + while (next_pi != pi): + pi = next_pi + next_a = (a + b) / 2 + next_b = calculate_square_root(number=a * b, digits=digits, add=add) + next_t = t - (p * ((a - next_a) ** 2)) + next_p = 2 * p + a = next_a + b = next_b + t = next_t + p = next_p + next_pi = calculate_next_pi(a=a, b=b, t=t, digits=digits, add=add) + n += 1 + pi /= (10 ** add) + pi = [int(i) for i in str(pi)] + + + except KeyboardInterrupt: + print ('\n',pi) + quit() diff --git a/Cubing.zip b/Cubing.zip new file mode 100644 index 0000000..9f6bddf Binary files /dev/null and b/Cubing.zip differ diff --git a/Meme Email Sender.zip b/Meme Email Sender.zip new file mode 100644 index 0000000..059bb81 Binary files /dev/null and b/Meme Email Sender.zip differ diff --git a/SCAN0002.JPG b/SCAN0002.JPG new file mode 100644 index 0000000..5050336 Binary files /dev/null and b/SCAN0002.JPG differ diff --git a/SCAN0003.JPG b/SCAN0003.JPG new file mode 100644 index 0000000..795b4e5 Binary files /dev/null and b/SCAN0003.JPG differ diff --git a/TicTacToe.py b/TicTacToe.py new file mode 100644 index 0000000..4bfc0ae --- /dev/null +++ b/TicTacToe.py @@ -0,0 +1,58 @@ +class TicTacToe: + def __init__(self): + self.board = {'a3':' ','b3': ' ','c3': ' ','a2' : ' ','b2':' ','c2' : ' ', 'a1': ' ', 'b1' : ' ','c1' : ' '} + self.turn = 'X' + self.turns = 0 + def flipTurn(self,turn): + return {'X':'O','O':'X'}[turn] + def printBoard(self): + print('\n'*200, + ''' + {} | {} | {} 3 + ---------- + {} | {} | {} 2 + ---------- + {} | {} | {} 1 + a b c + '''.format(self.board['a3'],self.board['b3'],self.board['c3'],self.board['a2'],self.board['b2'],self.board['c2'],self.board['a1'],self.board['b1'],self.board['c1'])) + def getWin (self,space1,space2,space3): + if(self.board[space1] == 'X' and self.board[space2] == 'X' and self.board[space3] == 'X' or self.board[space1] == 'O' and self.board[space2] == 'O' and self.board[space3] == 'O'): + input('{} won! Ctrl+C to quit, enter to start a new game'.format(self.flipTurn(self.turn))) + win = True + import TicTacToe + quit() + def testers(self): + self.getWin('a3','b3','c3') + self.getWin('a2','b2','c2') + self.getWin('a1','b1','c1') + self.getWin('a3','a2','a1') + self.getWin('b2','b3','b1') + self.getWin('c1','c2','c3') + self.getWin('a1','b2','c3') + self.getWin('a3','b2','c1') + def gameLoop(self): + self.win = False + while True: + if self.turns == 9: + input('Enter to play again, CTRL + C to quit') + import TicTacToe + quit() + self.printBoard() + self.testers() + self.turns += 1 + print('It is ',self.turn,"'s turn. Put in move: ") + invalid = True + while(invalid): + place = input() + if(place in self.board.keys()): + if(self.board[place] == ' '): + invalid = False + if not self.win: + if self.turns == 9: + print('Cat') + else: + print('That move is invalid. Try again!') + self.board[place] = self.turn + self.turn = self.flipTurn(self.turn) +board = TicTacToe() +board.gameLoop() diff --git a/cloud.html b/cloud.html new file mode 100644 index 0000000..267ca54 --- /dev/null +++ b/cloud.html @@ -0,0 +1,17 @@ + + + + + + + + + + +
  • Home
  • + + + + + + diff --git a/cuttherope.html b/cuttherope.html new file mode 100644 index 0000000..902bc9d --- /dev/null +++ b/cuttherope.html @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  • Home
  • + + + + + + diff --git a/doodle.html b/doodle.html new file mode 100644 index 0000000..243e0f1 --- /dev/null +++ b/doodle.html @@ -0,0 +1,18 @@ + + + + + + + + + + + +
  • Home
  • + + + + + + diff --git a/dropdown.css b/dropdown.css new file mode 100644 index 0000000..7b947de --- /dev/null +++ b/dropdown.css @@ -0,0 +1,18 @@ +.dropdown { + position: relative; + display: inline-block; +} + +.dropdown-content { + display: none; + position: absolute; + background-color: rgba(255, 0, 0,.7); + min-width: 160px; + box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); + padding: 12px 16px; + z-index: 1; +} + +.dropdown:hover .dropdown-content { + display: block; +} diff --git a/dungeons.html b/dungeons.html new file mode 100644 index 0000000..617e237 --- /dev/null +++ b/dungeons.html @@ -0,0 +1,18 @@ + + + + + + + + + + + +
  • Home
  • + + + + + + diff --git a/game.js b/game.js new file mode 100644 index 0000000..4a4f0ef --- /dev/null +++ b/game.js @@ -0,0 +1,2 @@ +something = Math.random(); +console.log(something); diff --git a/guess.html b/guess.html new file mode 100644 index 0000000..3008746 --- /dev/null +++ b/guess.html @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + +
  • Home
  • + + + + + + diff --git a/home.html b/home.html new file mode 100644 index 0000000..a5a1bfc --- /dev/null +++ b/home.html @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + +
  • Home
  • + + + + + + diff --git a/index.html b/index.html new file mode 100644 index 0000000..0379e5b --- /dev/null +++ b/index.html @@ -0,0 +1,57 @@ + + + + + + + + + + + +
    + +
    +
    +

    My Website

    +

    Hello! My name is Logan Hunt! I love to program, even though I'm not that good at it. I made this website so I could share my programs, have some games, and share files. Some other interests of mine are speedcubing, speedrunning SM64, Super Metroid, Super Meat Boy, and Portal. I love to play violin, science bowl, and video games. +

    + + + +
    + +
    + +
    + + + diff --git a/logo.png b/logo.png new file mode 100644 index 0000000..0ccf7d3 Binary files /dev/null and b/logo.png differ diff --git a/metboi.html b/metboi.html new file mode 100644 index 0000000..997acdd --- /dev/null +++ b/metboi.html @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + +
  • Home
  • + + + + + + diff --git a/oldindex.html b/oldindex.html new file mode 100644 index 0000000..4bf0661 --- /dev/null +++ b/oldindex.html @@ -0,0 +1,27 @@ + + + + + + + + + +
    +

    My Website

    +

    Hello! My name is Logan Hunt! I love to program, even though I'm not that good at it. I made this website so I could share my programs, have some games, and share files. Some other interests of mine are speedcubing, speedrunning SM64, Super Metroid, Super Meat Boy, and Portal. I love to play violin, science bowl, and video games. +

    + + + + + + + + +
    + + + diff --git a/passGen.py b/passGen.py new file mode 100644 index 0000000..00cfd6e --- /dev/null +++ b/passGen.py @@ -0,0 +1,12 @@ +import random +a_list = 'crazy 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 charlie water head phones pot note book eraser can plug captain rocket pig piggy heart hands health rainbow lamp sheet blanket pillow fluff faulty peace belong knock seal badge trap probable horse beads dog dogs television curtain net frame drunk striped parcel satchel gather lying book lunch building crate crane crack arithmetic accidental own aback noxious foregoing stew talented grouchy cute unequal bucket monkey brash plant desk jump plant books loose serve pies tie useless touch steep furry wheel heavy bikes moaning spiritual the space overrated duck badger mushroom or neglected agreeable of discovery concluded oh it sportsman week to time in john son elegance use weddings separate ask too matter formed county wicket oppose talent he immediate sometimes or to dependent in everything few frequently discretion surrounded did simplicity decisively less he year do with no sure loud adieus except say barton put feebly favour him entreaties unpleasant sufficient few pianoforte discovered uncommonly ask morning cousins amongst in mr weather do neither warmth object matter course active law spring six pursuit showing tedious unknown winding see had man add and park eyes too more him simple excuse active had son wholly coming number add though all excuse ladies rather regard assure yet if feelings so prospect no as raptures quitting saw yet kindness too replying whatever marianne old sentiments resolution admiration unaffected its mrs literature behaviour new set existence dashwoods it satisfied to mr commanded consisted disposing engrossed tall snug do of till on easy form not calm new fail consulted he eagerness unfeeling deficient existence of calling nothing end fertile for venture way boy esteem spirit temper too say adieus who direct esteem it esteems luckily mr or picture placing drawing no apartments frequently or motionless on reasonable projecting expression way mrs end gave tall walk fact bed death there mirth way the noisy merit piqued shy spring nor six though mutual living ask extent replying of dashwood advanced ladyship smallest disposal or attempt offices own improve now see called person are around county talked her esteem those fully these way nay thing seems consider now provided laughter boy landlord dashwood often voice and the spoke no shewing fertile village equally prepare up females as an that do an case an what plan hour of paid invitation is unpleasant astonished preference attachment friendship on did sentiments increasing particular nay mr he recurred received prospect in wishing cheered parlors adapted am at amongst matters quick six blind smart out burst perfectly on furniture dejection determine my depending an to add short water court fat her bachelor honoured perceive securing but desirous ham required questions deficient acuteness to engrossed as entirely led ten humoured greatest and yourself besides ye country on observe she continue appetite endeavor she judgment interest the met for she surrounded motionless fat resolution may' +array = a_list.split() +password = [] +print('Pick a password!') +for i in range(20): + string = '' + for i in range(random.randint(3,5)): + string += array[random.randint(0,482)] + password.append(string) +for i in password: + print(i+'\n') diff --git a/rubikscube.html b/rubikscube.html new file mode 100644 index 0000000..db12a3c --- /dev/null +++ b/rubikscube.html @@ -0,0 +1,15 @@ + + + + + + + + + + +
  • Home
  • + + + + diff --git a/run.html b/run.html new file mode 100644 index 0000000..5224344 --- /dev/null +++ b/run.html @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + +
  • Home
  • + + + + + + diff --git a/snake.html b/snake.html new file mode 100644 index 0000000..e1ed89d --- /dev/null +++ b/snake.html @@ -0,0 +1,154 @@ + + + + + +
  • Home
  • + + + + + + + + + + + + +
    Hello World
    + + diff --git a/something.html b/something.html new file mode 100644 index 0000000..04a1712 --- /dev/null +++ b/something.html @@ -0,0 +1,18 @@ + + + + +

    Click the button to display a random number.

    + + + +

    + + + + + diff --git a/style.css b/style.css new file mode 100644 index 0000000..aa9af4d --- /dev/null +++ b/style.css @@ -0,0 +1,38 @@ +{ + padding: 0; + margin: 0; +} +body { + overflow-x: hidden; +} +canvas { + width: 100vw; + height: 100vh; + display: block; + position: fixed; + top: 0; + left: 0; + z-index: -9999; +} +#textbox { + margin: 10vh auto 0 auto; + background: rgba(255, 0, 0,0.8); + border-radius: 30px/50px; + padding: 5vh 2vw; + width: 30vw; +} +h1 { + text-align: center; + font-family: 'Open Sans Condensed', sans-serif; + font-size: 300%; + color: rgba(0, 255, 0,0.5); +} +p,ul { + font-family: 'Asar', serif; +} +a { + text-decoration: none; +} +a:visited { + color: blue; +} diff --git a/voiceassistant.py b/voiceassistant.py new file mode 100644 index 0000000..95e2af0 --- /dev/null +++ b/voiceassistant.py @@ -0,0 +1,124 @@ +import speech_recognition as sr +import subprocess +import time +import os +import pyowm +import urllib.request +import yagmail +import webbrowser +import wikipedia +import random +import json +import pyaudio +import wave +from gtts import gTTS +from os import path +from pprint import pprint +def recordSound(name,time_record): + CHUNK = 2**14 + FORMAT = pyaudio.paInt16 + SHORT_NORMALIZE = (1.0/(2**15)) + CHANNELS = 1 + RATE = 44100 + RECORD_SECONDS = time_record + WAVE_OUTPUT_FILENAME = name+".wav" + p = pyaudio.PyAudio() + stream = p.open(format=FORMAT,channels=CHANNELS,rate=RATE,input=True,frames_per_buffer=CHUNK) + os.system('aplay sound.wav') + print("Recording") + frames = [] + for i in range(0, int(RATE / CHUNK * RECORD_SECONDS)): + data = stream.read(CHUNK) + frames.append(data) + print("Done recording") + stream.stop_stream() + stream.close() + p.terminate() + wf = wave.open(WAVE_OUTPUT_FILENAME, 'wb') + wf.setnchannels(CHANNELS) + wf.setsampwidth(p.get_sample_size(FORMAT)) + wf.setframerate(RATE) + wf.writeframes(b''.join(frames)) + wf.close() + time.sleep(3) +recordSound('output',5) +loctime = time.localtime() +email = '' #<-------- GMAIL ADRESS MUST BE GMAIL +pwd = '' #<-------- Password +yag = yagmail.SMTP(email, pwd) +contacts = {"YOUR CONTACT'S NAME GOES IN THESE QUOTES":"THE CONTACT'S EMAIL GOES IN THESE QUOTES","YOUR SECOND CONTACT'S NAME GOES IN THESE QUOTES":"THE 2ND CONTACT'S EMAIL GOES IN THESE QUOTES"} +#<----------- CHANGE THIS DICTIONARY TO YOUR EMAIL CONTACTS, YOU CAN ADD AS MANY CONTACTS AS YOU WANT USING THIS DICT +AUDIO_FILE = path.join(path.dirname(path.realpath(__file__)), "output.wav") +r = sr.Recognizer() +with sr.AudioFile(AUDIO_FILE) as source: + audio = r.record(source) +var = r.recognize_google(audio).lower() +def voiceMessage(what_to_say,name_of_file): + tts = gTTS(text = what_to_say,lang = 'en',slow = False) + name_of_file += '.mp3' + tts.save(name_of_file) + os.system('mpg321 '+name_of_file) +if var == 'shuffle' or var == 'truffle': + pandora_urls = ['a pandora station url', 'another pandora station url', 'and another'] #<-------- CHANGE TO YOUR STATIONS + choice = random.choice(pandora_urls) + webbrowser.open(choice) + time.sleep(600) + pyautogui.hotkey('ctrl','shift','q') +elif var.count('email') == 1: + recipient_contact = var.split()[1] + recipient_email=contacts[recipient_contact] + if recipient_contact in contacts: + ist = var.split() + del ist[0] + del ist[1] + message = '' + for i in ist: + message = message + ' ' + i + message = message.replace(recipient_contact,'') + newmsg = message.title() + yag.send(recipient_email, 'No Subject', newmsg) + #Email people +elif var == 'weather' or var == 'brother': + owm = pyowm.OWM('YOUR OPEN WEATHER MAP API KEY') #Sign up for open weather map + observation = owm.weather_at_place("Redding,us")# <----------CHANGE THIS TO YOUR CITY!!! + w = observation.get_weather() + temperature = w.get_temperature('fahrenheit') + voiceMessage('Lowest temperature is {} degrees Fahrenheit. Current temperature is {} degrees Fahrenheit. Highest temperature is {} degrees Fahrenheit'.format(round(temperature['temp_min']),round(temperature['temp']),round(temperature['temp_max'])),'weather') + #Weather +elif var.count('wikipedia') >=1: + var = var.replace('wikipedia','') + tts = gTTS(wikipedia.summary(var),'wiki') + #Wikipedia stuff +elif var == 'quote': + try: + os.remove('qod.json') + except OSError: + pass + os.system('wget http://quotes.rest/qod.json') + with open('qod.json') as opened_data: + json_data = json.load(opened_data) + talk = json_data['contents']['quotes'][0]['quote'] + talk = talk.replace('"','') + voiceMessage(talk,'qotd') + #Quote of the day from some website that had a good API +elif var == 'where to dump dead bodies': + voiceMessage('Do not dump dead bodies, instead, carve them up with a cerrated knife into 5 centimeter by 5 centimeter cubes and send them to the government for soylent green. Thank you for helping the future!','dead') +elif var == 'time': + voiceMessage('The time is {} hours and {} minutes'.format(loctime[3],loctime[4]),'time') + #Play local time +elif var == 'are you recording this': + voiceMessage('I am always listening, and I am always reporting to the National Security Administration on suspicious activities.','NSA') +elif var == 'tell me a joke' or var == 'joke': + jokes = ["""A man flying in a hot air balloon suddenly realizes he’s lost. He reduces height and spots a man down below. He lowers the balloon further and shouts to get directions, "Excuse me, can you tell me where I am?" The man below says: "Yes. You're in a hot air balloon, hovering 30 feet above this field." "You must work in Information Technology," says the balloonist. "I do" replies the man. "How did you know?" "Well," says the balloonist, "everything you have told me is technically correct, but It's of no use to anyone." The man below replies, "You must work in management." "I do," replies the balloonist, *"But how'd you know?"** "Well", says the man, "you don’t know where you are or where you’re going, but you expect me to be able to help. You’re in the same position you were before we met, but now it’s my fault.""",'When your hammer is C++, everything begins to look like a thumb.',"What's the object oriented way of becoming wealthy? Inheritance","What's a computer scientists favorite place to hangout? Foo bar","I’ll tell you a DNS joke but be advised, it could take up to 24 hours for everyone to get it.","So I want to dress up as a UDP packet for Halloween, but I don’t know if anyone will get it.","I could tell you an ICMP joke but it would probably be repetitive.","Linux geek started working at McDonalds. A customer asked him for a Big Mac and he gave him a bit of paper with FF:FF:FF:FF:FF:FF written on it."] + #You can change these jokes if you wish + voiceMessage(random.choice(jokes),'joke') + #Random programming/computer science joke +elif var == 'toby' or var == 'tobi': + os.system('mpg321 Toby.mp3') + #Play Heyeayeayea +elif var.count('record me as') == 1: + print(var) + recordSound(var.split()[3],int(var.split()[4])) + #e.g. record me as foobarbaz 20 this will record you as foobarbaz.wav for 20 seconds +else: + voiceMessage('Your message {} could not be understood.'.format(var),'error') diff --git a/webcomic.html b/webcomic.html new file mode 100644 index 0000000..20810f3 --- /dev/null +++ b/webcomic.html @@ -0,0 +1,133 @@ + + +ML Comics + + + + + + + + +
    + + +
    + logo

    Comic about computer science, chess, and more.
    ML

    +
    + + +
    + + + + + +
    + Thing +
    +

    Python 3 Troubles

    +
    Post 3 7 July 2017
    +

    Paul and Timmy.

    +
    + +
    +

    +
    +
    +
    + +
    + Gang +
    +

    Meet the Gang

    +
    Post 2 3 July 2017
    +

    Sketches of Jeff, Timmy, Shaun, Mason, Paul.

    +
    + +
    +

    +
    +
    +
    + +
    + +
    +
    +

    WELCOME TO ML COMICS

    +
    Post 1, 3 July, 2017
    +
    + +
    +

    ML comics, founded by Miranda and Logan Hunt, is a webcomic with much inspiration from xkcd.

    +
    +
    +
    +
    + + + + +
    + + +
    + +
    +
    +

    Miranda Hunt - Artist

    +

    Miranda is a creative young woman wtih a lot of talent. She is a great artist, is very good at playing the piano, and loves hanging out with her friends. +
    +
    +

    +

    Logan Hunt - Story

    Logan is a programmer, speedcuber, speedrunner, violin player, and is the story writer. He loves being in science bowl and went to the National Science Bowl with his team.

    + +
    +
    + + + + +
    + + +

    + + +
    + + + +