diff --git a/.gitignore b/.gitignore index 637d92c..d1148ba 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,7 @@ .idea/ -node_modules/ \ No newline at end of file +node_modules/ +*.log + +# OS garbage +Thumbs.db +~* diff --git a/Gruntfile.js b/Gruntfile.js index 545763a..d6571eb 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -9,11 +9,11 @@ module.exports = function(grunt) { } }, exec: { - compile_less:'lessc ./src/less/ordial.less ./src/css/ordial.css' + compile_less: 'lessc ./src/less/ordial.less ./src/css/ordial.css' } }); grunt.loadNpmTasks('grunt-exec'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.registerTask('default', ['watch']); -} \ No newline at end of file +}; \ No newline at end of file diff --git a/SpecRunner.html b/SpecRunner.html index e83bc91..d867ca5 100644 --- a/SpecRunner.html +++ b/SpecRunner.html @@ -5,17 +5,17 @@ Jasmine Spec Runner v2.0.0 - + - - - + + + - + diff --git a/index.html b/index.html index a76fda6..f3ac890 100644 --- a/index.html +++ b/index.html @@ -1,9 +1,11 @@ - + + +Ordial - + @@ -25,6 +27,7 @@ + @@ -64,19 +67,19 @@

Active Code

var rob = new Critter({mind: new CritterMind({decisionTree: moveForwardOrThink})}); function getCoord() { - return Math.floor(Math.random() * 10); + return Math.floor(Math.random() * 10); } function getCoords() { - return {x: getCoord(), y: getCoord()}; + return {x: getCoord(), y: getCoord()}; } for(var i = 0; i < 50; i++) { - world.place(new Resource(), getCoords()); + world.place(new Resource(), getCoords()); } for(var i = 0; i < 50; i++) { - var blocker = new Rock(); - world.place(blocker, getCoords()); + var blocker = new Rock(); + world.place(blocker, getCoords()); } rob.direction = _.sample(CardinalDirection.ALL_DIRECTIONS); @@ -98,7 +101,7 @@

Finding food

}; var turnLeftOrTurnRight = new DecisionNode(isNothingToTheLeftOfMe, Critter.Actions.TURN_LEFT, Critter.Actions.TURN_RIGHT); - var eatItOrThink = new DecisionNode(isThingInFrontOfMeEdible, Critter.Actions.MOVE_FORWARD, turnLeftOrTurnRight + var eatItOrThink = new DecisionNode(isThingInFrontOfMeEdible, Critter.Actions.MOVE_FORWARD, turnLeftOrTurnRight); var moveForwardOrThink = new DecisionNode(isSomethingInFrontOfMe, eatItOrThink, Critter.Actions.MOVE_FORWARD); var rob = new Critter({mind: new CritterMind({decisionTree: moveForwardOrThink})}); @@ -127,7 +130,7 @@

Zig Zag

var zig = [Critter.Actions.TURN_RIGHT, Critter.Actions.MOVE_FORWARD, Critter.Actions.DECREMENT_COUNTER]; var zag = [Critter.Actions.TURN_LEFT, Critter.Actions.MOVE_FORWARD, Critter.Actions.INCREMENT_COUNTER]; var toZigOrToZagThatIsTheQuestion = function(stimuli, vitals) { - return vitals.counter === 0; + return vitals.counter === 0; }; var zigZag = new DecisionNode(toZigOrToZagThatIsTheQuestion, zig, zag); anna = new Critter({mind: new CritterMind({decisionTree:zigZag })}); @@ -148,3 +151,18 @@

Turn, Run, and Make Babies

world.place(new Resource(), {x: 3, y: 4}); + + diff --git a/package.json b/package.json index 44b17da..dcb1ca9 100644 --- a/package.json +++ b/package.json @@ -11,20 +11,27 @@ "email": "atiraodhner@gmail.com" } ], - "main": "./src/ordial.js", "repository": { "type": "git", "url": "https://github.com/segfaultsoftware/ordial.git" }, + "main": "index.html", + "scripts": { + "start": "opener index.html", + "test": "opener SpecRunner.html", + "grunt": "grunt" + }, "dependencies": { "backbone": "1.1.x", "jquery": "2.1.x", "underscore": "1.5.x" }, "devDependencies": { - "less": "~2.0.0", + "opener": "~1.4.0", "grunt": "~0.4.5", + "grunt-cli": "^0.1.13", "grunt-contrib-watch": "~0.6.1", - "grunt-exec": "~0.4.6" + "grunt-exec": "~0.4.6", + "less": "~2.0.0" } } diff --git a/src/css/ordial.css b/src/css/ordial.css index 334ce54..8eec9ec 100644 --- a/src/css/ordial.css +++ b/src/css/ordial.css @@ -116,7 +116,11 @@ padding: 0; border: 0; } -textarea { - width: 500px; - height: 200px; +textarea, +.ace_editor { + width: 900px; + height: 220px; +} +body { + font-family: sans-serif; } diff --git a/src/less/ordial.less b/src/less/ordial.less index f313c20..6c5bf34 100644 --- a/src/less/ordial.less +++ b/src/less/ordial.less @@ -3,7 +3,12 @@ @import 'rock'; @import 'world'; -textarea { - width: 500px; - height: 200px; +textarea, +.ace_editor { + width: 900px; + height: 220px; +} + +body { + font-family: sans-serif; }