Skip to content

Instantly share code, notes, and snippets.

View aambrioso1's full-sized avatar
🏠
Working from home

Alex Ambrioso aambrioso1

🏠
Working from home
View GitHub Profile
@aambrioso1
aambrioso1 / PP.txt
Created August 19, 2019 22:47
PP.txt
(((())))()((((((((())()(()))(()((((()(()(((()((()((()(()()()()()))(((()(()((((((((((())(()()((())()(((())))()(()(()((()(()))(()()()()((()((()(((()()(((((((()()())()((((()()(((((()(())()(())((())()()))()(((((((())(()())(()(((())(()))((())))(()((()())))()())((((())))(()(((((()(())(((()()((()((()((((((((((())(()())))))()))())()()((((()()()()()()((((((())())(((()())()((()()(((()()()))(((((()))(((()(()()()(()(()(((())()))(()(((()((())()(()())())))((()()()(()()(((()))(((()((((()(((((()()(()())((()())())(()((((((()(()()))((((()))))())((())()()((()(()))))((((((((()))(()()(((())())(())()((()()()()((()((()((()()(((())))(()((())()((((((((()((()(()()(((())())())))(())())))()((((()))))))())))()()))()())((()())()((()()()))(()()(((()(())((((())())((((((((()()()()())))()()()((((()()))))))()((((()(((()))(()()())))((()()(((()))()()())())(((())((()()(())()()()(((())))))()())((()))()))((())()()())()())()()(()))())))())()))(())((()(())))(()(())(()))))(()(())())(()(())(()(()))))((()())()))()((((()()))))())))()()())((())()((()()())
@aambrioso1
aambrioso1 / recycle.py
Created August 26, 2019 04:01
recycle.py
e=1
f=9
c=3
def drinks(e,f,c):
total = 0
while((e + f) >= c): # Do we have enough empties?
d = (e + f)//c # How many can Tom buy?
left = (e + f) % c # How many leftover?
total += d # How many did Ton drink this time?
e = d # More empty bottle
@aambrioso1
aambrioso1 / recycle.py
Created August 26, 2019 04:06
recycle.py
# Project
def drinks(e,f,c):
total = 0
while((e + f) >= c): # Do we have enough empties?
d = (e + f)//c # How many can Tom buy?
f = (e + f) % c # How many leftover?
total += d # How many did Ton drink this time?
e = d # More empty bottle
return total
@aambrioso1
aambrioso1 / apr.py
Created September 8, 2019 13:00
apr.py
"""
0 1,500.00 0.00
1 1,308.52 44.18
2 1,210.59 64.08
3 1,111.17 82.49
4 1,010.24 99.39
5 907.77 114.75
6 803.75 128.56
7 698.14 140.78
8 590.93 151.40
@aambrioso1
aambrioso1 / tictactoe.py
Created September 9, 2019 19:09
tictactoe.py
alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
row_list = ['AAA', 'BBB', 'AAA']
bd = row_list[0] + row_list[1] + row_list[2]
"""
@aambrioso1
aambrioso1 / tictactoe.py
Created September 9, 2019 19:12
tictactoe.py
alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
row_list = ['AAA', 'BBB', 'AAA']
bd = row_list[0] + row_list[1] + row_list[2]
"""
@aambrioso1
aambrioso1 / mastermind.py
Created September 12, 2019 05:09
mastermind.py
# We count two things. (1) How many letters are correct but in the wrong position. This is r and the first number in the output. (2) How many letters are correct but in the weon position
# Input variables.
length = 8
code = 'ABCDEEFF'
guess ='AEFFECDZ'
# The set of letters in the code. This is used to elimimate repetitions.
let = set(code)
@aambrioso1
aambrioso1 / mastermind.py
Created September 12, 2019 05:24
mastermind.py
# We count two things. (1) How many letters are correct but in the wrong position. This is r and the first number in the output. (2) How many letters are correct but in the wrong position. This is s and the second number output.
# Input variables.
length = 4
code = 'BACC'
guess ='CABB'
# The set of letters in the code. This is used to elimimate repetitions.
let = set(code)
@aambrioso1
aambrioso1 / streak.py
Created October 13, 2019 23:51
streak.py
# Find the length of the longest streak of positive values in a list of numbers
gains1 = [-2 ,-2, 1, 1]
def find_streak(values):
streakimg = False
streak = 0
pos = 0
start = 0
finish = 0
current_start = 0
@aambrioso1
aambrioso1 / reader.py
Created December 6, 2019 14:45
reader.py
import requests
import re
from collections import Counter
import speech as sp
r = requests.get('http://www.gutenberg.org/cache/epub/5/pg5.txt')
txt = r.text
start = 'THE CONSTITUTION OF THE UNITED STATES OF AMERICA'