Skip to content

Instantly share code, notes, and snippets.

@kesne
kesne / game.js
Created May 15, 2012 06:18
Example of villo.Game in villoJS.
​var mmo = new villo.Game({
//Give it some name. This doesn't really make a big difference:
name: "mmo"​​​,
//The type defines how it behaves. All is a safe type to use in most cases.
type: "all",
//This defines what features we want to import. In this example, we're only using data.
use: ["data"],
//Define some events for the system:
events: {
​​​​​​​​//Define the function that is called when data data is received from the data.interval function later on.
@kesne
kesne / store.js
Created May 13, 2012 02:48
Storage replacement for villo.js.
store = {
set: function(name, value, days){
var expires = ""
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires = "; expires="+date.toGMTString();
}
document.cookie = name+"="+value+expires+"; path=/";
},
@kesne
kesne / villo.wp7.js
Created May 13, 2012 01:07
An attempt to fix compatibility problems with Villo 0.9.9 and WP7.
villo.ajax = function (url, modifiers) {
//Set up the request.
var vAJ = new XMLHttpRequest();
if (vAJ) {
var request = new XMLHttpRequest();
if ("withCredentials" in request) {
//Good Browsers
//Line up the variables to be sent.
var sendingVars = "";
/* play.c */
#include "mp2.h"
/***************************************************************** shuffle *****************************************************************************************/
void shuffle(int cards[][12], int num_cards[], int drawnDeck[])
{