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
// require() some stuff from npm (like you were using browserify) | |
// and then hit Run Code to run it on the right | |
// Require a default instance of immstruct (singleton instance) | |
var immstruct = require('immstruct'); | |
// Get the structure we previously defined under the ID `myKey` | |
var structure = immstruct('myKey', { a: { b: { c: 1 } } }); | |
var cursor = structure.cursor(['a', 'b', 'c']); |
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
/** | |
* Copyright 2012 Google Inc. All Rights Reserved. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
class Planet | |
constructor: (@name,@size,@x,@y) -> | |
# I want an empty object to store ship in later | |
@ships = {} | |
battle: -> | |
#if more then one player has ships at this planet run the battle simulation | |
for p of @ships | |
damage = randint(@ships[p]) | |
# todo, remove ships based on damage here |
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
class Planet | |
constructor: (@name,@size,@x,@y) -> | |
@ships = {} | |
@damage_pool = {} | |
add_ships: (player,amount) -> | |
#add ships to an array based on the player who owns them | |
log("adding #{amount} ships to player #{player}") | |
if @ships[player]? |
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
Planet = function(_a, _b, _c, _d) { | |
this.y = _d; | |
this.x = _c; | |
this.size = _b; | |
this.name = _a; | |
return this; | |
}; | |
this.ships = {}; | |
this.damage_pool = {}; |
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
var cnt, mes, s, sender, util, zmq; | |
zmq = require('zeromq'); | |
util = require('util'); | |
s = zmq.createSocket('pub'); | |
s.bind('tcp://127.0.0.1:5559', function(err) { | |
if (err) { | |
throw err; | |
} | |
util.puts('binding'); |
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
using UnityEngine; | |
using System.Collections; | |
public class maker : MonoBehaviour { | |
// Use this for initialization | |
void Start () { | |
Material mat = Resources.Load("unlit",typeof(Material)) as Material; | |
if(mat == null) |
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
#include <iostream>; | |
#include <string>; | |
#include <cmath>; | |
using namespace std; | |
int main() | |
{ | |
int n=0; //counter | |
int t=0; //user-input number of iterations | |
double young=0.0; //the new sum |
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
dependencies: | |
cache_directories: | |
- google_appengine # relative to the build directory | |
- pyyaml | |
pre: | |
- bash ./installAppEngine.sh | |
machine: | |
environment: | |
PYTHONPATH: $HOME/google_appengine:$HOME/pyyaml |
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
#!/bin/bash | |
GAEPATH="$HOME/google_appengine" | |
PYYAMLPATH="$HOME/pyyaml" | |
if [ ! -d "$GAEPATH" ]; then | |
curl -O https://googleappengine.googlecode.com/files/google_appengine_1.8.0.zip | |
unzip -q -d $HOME google_appengine_1.8.0.zip | |
else | |
echo "already installed app engine" | |
fi |
OlderNewer