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
--# Main | |
-- NN | |
function setup() | |
-- Neural Network of 3 layers with 3 inputs | |
local x = {Value(1), Value(1), Value(1)} | |
local layer1 = Layer(3, 4) -- layer of 4 neurons with 3 inputs | |
local layer2 = Layer(4, 4) -- layer of 4 neurons with 4 inputs | |
local layer3 = Layer(4, 1) -- layer of 1 neuron with 4 inputs | |
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
--# Main | |
-- Rymdskepp | |
function setup() | |
viewer.mode = FULLSCREEN | |
setupMenu() | |
end | |
function setupMenu() |
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 numpy as np | |
def one(part=2): | |
"""Find the maximum sum, or the three maximum sums for rows of values""" | |
with open('input.txt', 'r') as f: | |
data = [np.sum(np.fromstring(d, sep="\n", dtype=int)) for d in f.read().split("\n\n")] | |
if part == 2: | |
print("one:2:", np.sum(np.sort(data)[-3:])) | |
else: |
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 cb | |
import struct | |
MOTION_SERVICE = "00030000-78fc-48fe-8e23-433b3a1942d0" | |
HR_SERVICE = '180d' | |
STEP = "00030001-78fc-48fe-8e23-433b3a1942d0" | |
RAW_MOTION = "00030002-78fc-48fe-8e23-433b3a1942d0" | |
HEART_RATE = '2a37' | |
CHARACTERISTICS = [STEP, RAW_MOTION, HEART_RATE] |
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
--# Main | |
function setup() | |
viewer.mode = FULLSCREEN | |
walls = { | |
physics.body(EDGE, vec2(0, 0), vec2(WIDTH, 0)), | |
physics.body(EDGE, vec2(0, 0), vec2(0, HEIGHT)), | |
physics.body(EDGE, vec2(WIDTH, HEIGHT), vec2(WIDTH, 0)) | |
} | |
for k, v in ipairs(walls) do |
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
--# Main | |
function setup() | |
displayMode(FULLSCREEN) | |
s = Scene() | |
e = Editor(64) | |
s:add(Background()) | |
s:add(e) | |
s:add(DPad(e)) | |
s:add(SelectTile(e)) |
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
--# Main | |
-- Picker | |
-- Use this function to perform your initial setup | |
function setup() | |
p = Picker() | |
end | |
-- This function gets called once every frame |
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
--# Main | |
-- Voronoi | |
function draw() | |
background(40, 40, 50) | |
startVoronoi() | |
end | |
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
--# Main | |
-- March | |
function setup() | |
local function sp(p) | |
return p:len() * p:dist(vec3(5,3,0)) | |
end | |
local st = os.clock() | |
local vs = volume(sp, 9, .5, 6) | |
print(os.clock() - st) |
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
--# Main | |
function setup() | |
parameter.boolean("FILL") | |
parameter.integer("RANGE", 1,20,3) | |
parameter.boolean("LINE") | |
parameter.boolean("FOV") | |
parameter.boolean("MOVE") | |
hs = Hexagons():createMesh():set(0,0,color(207, 67, 67)) | |
u = Unit(hs:pos(0,0)) |
NewerOlder