Skip to content
This repository was archived by the owner on Jul 18, 2020. It is now read-only.
Open

WIP #284

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/Algorithms.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions recipe_batches/recipe_batches.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
#!/usr/bin/python

import math
#MAKE SURE EACH VALUE IN THE RECIPE IS GREATER THAN OR EQUAL TO ON HAND THEN DEVIDE THE NUMBER OF INGREDIENTS BY THE NUMBER IN RECIPIE LOWSEST NUMBER WINS
# IF NOT BATCHES 0

def recipe_batches(recipe, ingredients):
pass

recipie_amount = []
ingredients_amt = []
max_batches = 0
counter = 0
for i in recipe.values():
recipie_amount = i
print(recipie_amount)
for i in ingredients.values():
ingredients_amt = i
print ingredients_amt

if __name__ == '__main__':
# Change the entries of these dictionaries to test
Expand Down
18 changes: 17 additions & 1 deletion rock_paper_scissors/rps.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,24 @@
import sys

def rock_paper_scissors(n):
pass
#Define list of plays and possibilites
plays = ["rock", "paper", "scissors"]
all_poss = []

#Helper function to keep track of the amt or rounds left and the results
def rounds(rleft,res):


if rleft== 0:
all_poss.append(res)
return

for i in range(0,len(plays)):
rounds(rleft -1, res + [plays[i]])

rounds(n,[])
return all_poss


if __name__ == "__main__":
if len(sys.argv) > 1:
Expand Down
14 changes: 13 additions & 1 deletion stock_prices/stock_prices.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,20 @@
import argparse

def find_max_profit(prices):
pass
profit = prices[1] - prices[0]
cost = prices[0]

#for each price starting at the second item in the list
for price in prices[1:]:
# if the price - the cost is greater than profit set profit equal to price minus cost
if (price - cost) > profit:
profit = price - cost
# if the price is less than the cost set cost equal to the new price
if price < cost:
cost = price


return profit

if __name__ == '__main__':
# This is just some code to accept inputs from the command line
Expand Down