Skip to content

Instantly share code, notes, and snippets.

@gahooa
gahooa / wordfind.py
Last active March 12, 2018 05:20
A quick demo of a word find solver
board = '''
m a i n v f
a n a f d d
s m i t h a
i r o n r v
e m o z a i
a e e t a d
'''
@gahooa
gahooa / vis.py
Created February 15, 2018 05:20
vispy sinewave
# -*- coding: utf-8 -*-
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Demonstration of InfiniteLine visual.
"""
import sys
import numpy as np
@gahooa
gahooa / sinewave.py
Last active February 13, 2018 04:47
PyOpenGL Sine Wave
#!/usr/bin/env python
###############################################################################
# Action Happens Here 50 times per second
def tick(i):
#glRotatef(1, 0, 0, 1)
#glTranslatef(0, 0, 1)
#!/usr/bin/env python
"""Draw a cube on the screen. every frame we orbit
the camera around by a small amount and it appears
the object is spinning. note i've setup some simple
data structures here to represent a multicolored cube,
we then go through a semi-unopimized loop to draw
the cube points onto the screen. opengl does all the
hard work for us. :]
"""
"""
It's worth pointing out that python complex numbers are great for storing positions,
sizes, momentum, and polar/rect calculations. See the cmath module for details.
"""
from random import random
import sys
import math
from cmath import polar, rect