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
printIndiv indiv : Vector<Byte> | |
print String(indiv.data) |
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
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 |
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
struct Color | |
r : Int | |
g : Int | |
b : Int | |
a = Color(255, 255, 255) |
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
struct Color | |
r : Int | |
g : Int | |
b : Int | |
doSomething | |
... | |
get | |
saturation |