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
MyClass | |
init | |
... | |
doSomething | |
my.a = 5 | |
public | |
a |
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
win = GraphicsWindow("Flua - Frames", 800, 600) | |
for frames in win.frames | |
... |
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 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 |
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
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 |
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
Color | |
init my.red = 1.0, my.green = 1.0, my.blue = 1.0, my.alpha = 1.0 | |
... | |
public | |
* |
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 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 |
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 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 |
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 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 |
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
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) | |
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
printIndiv indiv : Vector<Byte> | |
print String(indiv.data) |