Skip to content

Instantly share code, notes, and snippets.

View PerroBueno's full-sized avatar
🙈

Gleeo PerroBueno

🙈
  • Gamma Quadrant
View GitHub Profile
@PerroBueno
PerroBueno / No_Guess_2.py
Created August 9, 2018 22:50
Guesses a number that you think of
#Number Guesser 2
print("Think of a number between 1 and 100.")
def checker(guess):
nums = [1,2,3]
print("Number is "+ str(guess) + ". Is my answer:")
print("[1] correct")
print("[2] Too high")
print("[3] Too low")
while True:
@PerroBueno
PerroBueno / linbinsearch.py
Created May 26, 2018 23:23
binary search
import random
#Linear search
def linseach(ordered_list, element_to_find):
for i in ordered_list:
if i == element_to_find:
return True
return False
#Binary search
@PerroBueno
PerroBueno / fib.py
Created May 5, 2018 23:51
Prints some fib numbers
def fibonacci():
count = int(input("How many fibs?"))
n1 = 1
n2 = 0
sequence = [0]
for i in range(count):
sequence.append(n1)
n1 = n1 + sequence[n2]
n2 += 1
del sequence[0]
@PerroBueno
PerroBueno / rps.py
Last active May 5, 2018 23:41
Rock Paper Scissors
def rps():
one = input("Player one Choose rock, paper or scissors").lower()
two = input("Player two Choose rock, paper or scissors").lower()
list = ["rock", "scissors", "paper", "rock"]
if (one or two) not in list:
print("fail")
else:
if one == two:
print("draw")
elif (list.index(one) + 1) == (len(list) - 1 - list[::-1].index(two)):