Skip to content

Instantly share code, notes, and snippets.

View AndyNovo's full-sized avatar

Andy Novocin AndyNovo

View GitHub Profile
@AndyNovo
AndyNovo / input.py
Last active September 3, 2015 18:49
birthday = input('What is your birthday (yyyy/mm/dd)? ')
print("You entered:",birthday)
#My opening explanation
print("""
Welcome to the Green Room. Where you can have
coffee but not tea, a muffin but not cake, and
pet a giraffe but not a cat.
Please ask me about an object and I'll tell you
if it is allowed. Tell me "quit" to stop the game.
You'll have to decide for yourself when you've won.
""")
import urllib.request
filename, headers = urllib.request.urlretrieve('http://api.icndb.com/jokes/random')
response = open(filename)
json = eval(response.read())
print(json['value']['joke'])
import sys
import email
import dateutil.parser
import sqlite3
mail = sys.stdin.read()
msg = email.message_from_string(mail)
datetime = dateutil.parser.parse(msg["DATE"])
thedata = {
"subject" : msg["SUBJECT"],
@AndyNovo
AndyNovo / tree.py
Created September 15, 2015 18:26
ASCII Christmas Tree with Snow
import random, os, sys, time
#Animate some ASCII art (thanks Philip: http://stackoverflow.com/a/2785568/1347629)
def draw_to_screen(content):
clear_console = 'clear' if os.name == 'posix' else 'CLS'
os.system(clear_console)
sys.stdout.write(content)
sys.stdout.flush()
time.sleep(0.2)
#Some randomized snow
import random, os, sys, time
#Animate some ASCII art (thanks Philip: http://stackoverflow.com/a/2785568/1347629)
def draw_to_screen(content):
clear_console = 'clear' if os.name == 'posix' else 'CLS'
os.system(clear_console)
sys.stdout.write(content)
sys.stdout.flush()
time.sleep(0.2)
def board(w, h, x, y):
#include<iostream>
int main(){
int number_of_rounds = 0;
std::cin >> number_of_rounds;
int k = 0;
for(int i = 0; i < number_of_rounds; i++){
for(int j = 0; j < number_of_rounds; j++){
k = j;
}
@AndyNovo
AndyNovo / linear.cpp
Last active September 21, 2015 19:50
#include<iostream>
int main(){
unsigned long number_of_rounds = 0;
std::cin >> number_of_rounds;
unsigned long j = 0;
for(unsigned long i = 0; i < number_of_rounds; i++){
j = i;
}
return 0;
#include<iostream>
#include<string>
int main(){
unsigned long number_to_hit;
std::cin >> number_to_hit;
unsigned long j = 0;
for(unsigned long i = 0; j < number_to_hit; i++){
j = i * i;
}
#include<iostream>
#include<string>
int main(){
std::string number_of_rounds;
std::cin >> number_of_rounds;
int j = 0;
for(int i = 0; i < number_of_rounds.length(); i++){
j = i;
}