Skip to content

Instantly share code, notes, and snippets.

ColorRGBA
init my.red = 1.0, my.green = 1.0, my.blue = 1.0, my.alpha = 1.0
...
init color : ColorRGBA
on my
red = color.red
green = color.green
blue = color.blue
alpha = color.alpha
Color
init my.red = 1.0, my.green = 1.0, my.blue = 1.0, my.alpha = 1.0
...
public
*
import flua.Collection
import flua.Utils
#import playground.Everything
TARGETSTRING = "This is the string that will be evolved. Let's make it longer and longer and longer still.. This is the string that will be evolved. Let's make it longer and longer and longer still.. This is the string that will be evolved. Let's make it longer and longer and longer still.. This is the string that will be evolved. Let's make it longer and longer and longer still.. "
const
POPSIZE = 1000
MUTATIONRATE = 1
import flua.Collection
import flua.Utils
#import playground.Everything
TARGETSTRING = "This is the string that will be evolved. Let's make it longer and longer and longer still.. This is the string that will be evolved. Let's make it longer and longer and longer still.. This is the string that will be evolved. Let's make it longer and longer and longer still.. This is the string that will be evolved. Let's make it longer and longer and longer still.. "
const
POPSIZE = 1000
MUTATIONRATE = 1
import playground.Everything
TARGETSTRING = "This is the string that will be evolved. Let's make it longer and longer and longer still.."
const
POPSIZE = 10
MUTATIONRATE = 3
population = Array<Vector<Byte>>(POPSIZE)
bestScore : Int = 1
printIndiv indiv : Vector<Byte>
print String(indiv.data)
def findNodes(node, nodeName):
callList = []
if node.nodeType == Node.ELEMENT_NODE and node.tagName == nodeName:
callList.append(node)
# TODO: Improve performance, make an iterative algorithm out of this:
for child in node.childNodes:
callList += findNodes(child, nodeName)
drawRect x1, y1, x2, y2, filled = true
glDisable GL_TEXTURE_2D
if filled
glBegin GL_QUADS
else
glBegin GL_LINE_STRIP
glVertex2i x1, y1
glVertex2i x1, y2
struct Color
r : Int
g : Int
b : Int
a = Color(255, 255, 255)
struct Color
r : Int
g : Int
b : Int
doSomething
...
get
saturation