Skip to content

Instantly share code, notes, and snippets.

View natebot13's full-sized avatar

Nathan natebot13

View GitHub Profile
@natebot13
natebot13 / asteroids.py
Created August 16, 2017 18:52
asteroids template
import pygame
from math import sin, cos, radians
class Asteroid:
def __init__(self, x, y):
self.shape = None
self.position = (x,y)
class Ship:
import pygame
# initialize game engine
pygame.init()
# set screen width/height and caption
WIDTH = 640
HEIGHT = 480
SIZE = (WIDTH, HEIGHT)
screen = pygame.display.set_mode(SIZE)
pygame.display.set_caption('My Game')
################################################################################
# This is the function that the game calls to determines where the computer
# is going to move next. It's given the state of the world. The world
# looks like this:
#
# {'X': {0,1,..}, 'O': {3,4..}, 'empty': {5,6,..}}
#
# 'xs' points to a list of spaces where x has placed marks
# 'os' points to a list of spaces where o has placed marks
# 'empty' points to a list of spaces where nobody has made marks
@natebot13
natebot13 / blank_graphsearch.py
Created July 11, 2017 09:41
Blank graph visualization
import pygame
class node:
def __init__(self, value):
self.value = value
self.visited = False
self.neighbors = []
self.selected = False
self.onPath = False

Keybase proof

I hereby claim:

  • I am natebot13 on github.
  • I am natebot13 (https://keybase.io/natebot13) on keybase.
  • I have a public key whose fingerprint is 4629 B194 2753 F4DD CDE4 8957 B956 BD2B 792A 3975

To claim this, I am signing this object: