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
const assert = require('assert'); | |
const _ = require('lodash'); | |
const {is_identifier, is_variable, merge_identifiers, string_to_units} = require('./identifiers'); | |
const {term_to_string} = require('./display'); | |
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
#WARNING: Horribly messy code below - use caution | |
#Artificial life program written in python and pygame | |
import pygame, random, colorsys, math | |
resolution = 100 | |
blockSize = 6 | |
mutationRate = 0.00022 | |
environment = 100 |
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
// Create the tree | |
var box = new THREE.Box3(new THREE.Vector3(-25, -25, -25), new THREE.Vector3(25, 25, 25)); | |
var tree = new Octree(box, { | |
maxDepth: 10, | |
splitThreshold: 5, | |
joinThreshold: 3 | |
}); | |
scene.add(tree); | |
// Add children the same way you would any other regular object. |
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
# This function prints out all of the values and sub-values in any variable, including | |
# lists, tuples and classes. It's not very efficient, so use it for testing/debugging | |
# purposes only. Examples are below: | |
#------------------------------------------------------------------------------------- | |
# ShowData(range(10)) | |
# (list) | |
# (int) 0 |