This file contains hidden or 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
| -- Standard awesome library | |
| require("awful") | |
| require("awful.autofocus") | |
| require("awful.rules") | |
| -- Theme handling library | |
| require("beautiful") | |
| -- Notification library | |
| require("naughty") | |
| -- {{{ Variable definitions |
This file contains hidden or 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
| > Generating individual 1 | |
| Generating individual 2 | |
| Generating individual 3 | |
| Generating individual 4 | |
| Generating individual 5 | |
| Generating individual 6 | |
| Generating individual 7 | |
| Generating individual 8 | |
| Generating individual 9 | |
| Generating individual 10 |
This file contains hidden or 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
| > > run_sim() | |
| Doing individual 1 | |
| Doing individual 2 | |
| Doing individual 3 | |
| Doing individual 4 | |
| Doing individual 5 | |
| Doing individual 6 | |
| Doing individual 7 | |
| Doing individual 8 | |
| Doing individual 9 |
This file contains hidden or 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
| function new_node(arity, value) | |
| local new_node = {} | |
| new_node['arity'] = arity | |
| new_node['child_count'] = 0 | |
| new_node['children'] = {} | |
| new_node['type'] = type(value) == "function" and "function" or "terminal" | |
| new_node['value'] = value | |
| new_node['parent'] = nil | |
| return new_node |
This file contains hidden or 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
| require "node" | |
| function adjusted_fitness(standard_fitness) | |
| local denominator = 1 + standard_fitness | |
| return 1 / denominator | |
| end | |
| function generate_full(functions, terminals, max_depth) | |
| local root = nil | |
| if max_depth > 1 then |
This file contains hidden or 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 code was created by Jeff Molofee '99 (ported to Linux/GLUT by Richard Campbell '99) | |
| // | |
| // If you've found this code useful, please let me know. | |
| // | |
| // Visit me at www.demonews.com/hosted/nehe | |
| // (email Richard Campbell at ulmont@bellsouth.net) | |
| // | |
| #include <GL/glut.h> // Header File For The GLUT Library | |
| #include <GL/gl.h> // Header File For The OpenGL32 Library |
This file contains hidden or 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
| #include <stdio.h> | |
| int main(int argc, char *argv[]) | |
| { | |
| char *output; | |
| if (argc > 1) | |
| output = argv[1]; | |
| else | |
| output = "y"; | |
| while(1) |
This file contains hidden or 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
| require 'ast' | |
| class Parser | |
| attr_accessor :stack | |
| attr_accessor :env | |
| attr_accessor :evaling | |
| def initialize(stack, words) | |
| @words = words | |
| @dec_valid = ('0'..'9').to_a + ['.'] + ['-'] | |
| @hex_valid = ('0'..'9').to_a + ('a'..'z').to_a |
This file contains hidden or 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
| >> [ 1 + ] add_word | |
| Data stack: | |
| >> 1 foo | |
| Data stack: | |
| 2.0 |
This file contains hidden or 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
| >> [ 1 2 + ] | |
| Data stack: | |
| "[" | |
| "[" | |
| 1.0 | |
| "[" | |
| 1.0 | |
| #<struct Quotation contents=[1.0, 2.0, #<Ruby_Word:0x00000001f9e8b0 @pops=2, @pushes=1, @apply=#<Proc:0x00000001f9e840@/home/baddog/dev/stacklang/environment.rb:15>>]> | |
| "[" | |
| 3.0 |