Skip to content

Instantly share code, notes, and snippets.

View selfsame's full-sized avatar

Joseph Parker selfsame

View GitHub Profile
; Problem 1 WRONG ANSWER
(defn accept-n [n]
(cond (== 0 (mod n 3)) n
(== 0 (mod n 5)) n
:else 0))
; First used inc 0 and take 999, off by one :(
; Not sure why it's still messing up
(apply + (map accept-n (take 1000 (iterate inc 1))))
(defn calc-socket [proxy]
(let [direction (state proxy :tag)
weight (state proxy :weight)
node (GET-N (:parent proxy))
value (state node :value)
inputs (state proxy :in)
outputs (state proxy :out)]
(cond
(= :in direction) (dorun
def do_magic(context):
lights = []
for o in context.scene.objects:
if o.type == "LAMP":
lights.append(o)
print(lights)
obj = context.active_object
bm = bmesh.new()
mesh = obj.data
bm.from_mesh(mesh)
public ShaderProgram MakeShader(){
String vertexShader =
"attribute vec4 " + ShaderProgram.POSITION_ATTRIBUTE + ";\n"
+ "attribute vec4 a_color ; \n"
+ "varying vec4 v_color ; \n"
+ "uniform mat4 u_worldView;"
+ "void main() \n"
+ "{ v_color = a_color; \n"
+ " gl_Position = a_position * u_worldView; \n"
float ticker = 0f;
public PerspectiveCamera camera;
public Scenario(myGame _game, GameScreen _game_screen) {
camera = new PerspectiveCamera( 46.596f, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
camera.rotate(180f, 0f,1f,0f);
camera.position.set(scene.camera[0], scene.camera[1], scene.camera[2]);
public void render(){