Skip to content

Instantly share code, notes, and snippets.

View AndyNovo's full-sized avatar

Andy Novocin AndyNovo

View GitHub Profile
@AndyNovo
AndyNovo / mouse.py
Last active November 15, 2015 23:39
import pygame
import random
BLACK = (0,0,0)
RED = (255, 0, 0) #These tuples are RGB by the way
WHITE = (255, 255, 255)
pygame.init()
WIDTH = 450
HEIGHT = 600
import pygame
import random
BLACK = (0,0,0)
RED = (255, 0, 0)
WHITE = (255, 255, 255)
pygame.init()
WIDTH = 450
HEIGHT = 600
import pygame
import random
BLACK = (0,0,0)
RED = (255, 0, 0)
WHITE = (255, 255, 255)
pygame.init()
screen = pygame.display.set_mode([450, 600])
import pygame
BLACK = (0,0,0)
RED = (255, 0, 0)
screen = pygame.display.set_mode([450, 600])
another_loop = True
clock = pygame.time.Clock()
RIFOXOL
9--2---9---2-NO
-4---3---3JOLE-
--4---2-2---I--
2--4---2--MUD-2
----4----MA----
-3---3-GROWTHS-
--2-G-DIED--2U-
9--CAVES---2-QI
--2-ZA2-2---T-N
#1) What value does the following expression evalutate to?
2 ** 3 ** 2
#2) Rewrite this code to use a for loop instead of a while loop:
n = 8
while n >= 1:
n -= 3
print(n)
#3) What is the type of the following expression:
n = int(input(""))
grade_book = {}
for i in range(n):
raw_line = input("")
L = raw_line.split()
student_name = L[0]
grades = list(map(float, L[1:]))
grade_book[student_name] = grades
lookup_name = input("")
#include <iostream>
using namespace std;
int main() {
//Create a class called DEPQ which implements
// (at least) three methods:
// void DEPQ::insert(n)
// int DEPQ::pop_max();
def generic_list_rec(L):
if L == []:
return something
else:
return f(generic_list_rec(L[1:]), L[0])
def generic_int_rec(n):
if n == 0:
return something
else:
<!doctype html>
<html>
<head>
<meta name="google-signin-client_id" content="CUSTOM_ID_HERE.apps.googleusercontent.com">
<title>CAS Test</title>
<script src="https://apis.google.com/js/platform.js" async defer></script>
</head>
<body>
<h1>Hi there</h1>
<h2>Please sign in with one of our authentication services:</h2>