This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
def encode(hour,minute,second,distance):#hour from 0-9 distance meters | |
hour=min(max(0,hour),9)*10000 | |
minute=min(max(0,minute),60)*100 | |
second=min(max(0,second),60) | |
distance=max(min(1609.344*32,distance),0) | |
return chr(hour+minute+second)+chr(int(distance))+chr(int(time.localtime().tm_year))+chr(int(time.localtime().tm_yday)) | |
def decode(s): | |
time=ord(s[0]) | |
dist=ord(s[1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyglet | |
if __name__=='__main__': | |
window=pyglet.window.Window() | |
class rcrect: | |
def __init__(self,x,y,h,w,r,color=[255,255,255,255]): | |
self.pos=[x,y] | |
self.x=x | |
self.y=y | |
self.h=h | |
self.w=w |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import sin, cos, tan, sqrt, pi | |
class Object: | |
def __init__(self, position, vertices, faces, colors): | |
self.position = position | |
self.vertices = vertices | |
self.faces = faces | |
self.colors = colors |