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
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
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
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
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
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 |
NewerOlder