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 java.util.*; | |
import java.util.concurrent.ConcurrentHashMap; | |
import java.util.stream.Stream; | |
//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or | |
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter. | |
public class Main { | |
public static class ll<E extends Comparable<E>> implements Iterator<E>, Iterable<E> { | |
//who needs nodes anyway |
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 cv2 | |
import numpy as np | |
import math | |
import pygame | |
zs=200 | |
#sample = light() | |
def cp(p): |
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
vec2 Rotate(in vec2 p, in float r) { | |
float c = cos(r), s = sin(r); | |
return p * mat2(c, -s, s, c); | |
} | |
// Hashes from "Hash without Sine" by Dave_Hoskins (https://www.shadertoy.com/view/4djSRW) | |
float Hash21(in vec2 p) { | |
vec3 p3 = fract(p.xyx * 0.1031); | |
p3 += dot(p3, p3.yzx + 33.33); | |
return fract((p3.x + p3.y) * p3.z); |
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 |