Skip to content

Instantly share code, notes, and snippets.

MyClass
init
...
doSomething
my.a = 5
public
a
win = GraphicsWindow("Flua - Frames", 800, 600)
for frames in win.frames
...
import playground.Everything
# Check bp.Documentation in the module browser on the left for some beginner topics.
WIDTH : Int = 640
HEIGHT : Int = 480
win = GraphicsWindow("aaaa", WIDTH, HEIGHT)
setupGL()
for frame in win.frames
glColor3f 1.0, 1.0, 1.0
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
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)
printIndiv indiv : Vector<Byte>
print String(indiv.data)