Skip to content

Instantly share code, notes, and snippets.

View SharpCoder's full-sized avatar
🛰️
inventing

Joshua Cole SharpCoder

🛰️
inventing
View GitHub Profile
@SharpCoder
SharpCoder / Political Simulator.js
Created August 4, 2014 21:47
This is the entry point for my political simulation game. Well, the game is actually about cause and effect. This is the core foundation that simulates the domino effect one mishap may have. In my engine, everything ultimately leads to murder...
// Created by SharpCoder (@debugglesoft)
// 08-03-2014
//
// politics.js is the event creation engine for
// the world. It simulates the interaction between
// people in power and everyone else.
Human = (function() {
function Human() {
this.Name = Helper.GetName();
this.Role = 'Union Member';
@SharpCoder
SharpCoder / core.js
Created December 1, 2014 16:34
Game Framework in JS
// 2014-08-22
// SharpCoder
// This is the core framework for my ludum dare 30 entry.
Drawable = function(config) {
config = config || {};
this.x = config.x || 0;
this.y = config.y || 0;
this.vx = config.vx || 0;
var dictionary = {};
module.exports = {
init: function(callback) {
var fs = require('fs');
fs.readFile('./moby/mobyposi.i', 'utf8', function( err, data ) {
var text = data.toString('utf8');
@SharpCoder
SharpCoder / story-gen.rst
Last active August 29, 2015 14:23
Sentence Generation as a Function of Classification

Sentence Generation as a Function of Classification =============================

This is a collection of thoughts I have regarding a potential engine for generating content. Bot-generated stories is a fascination of mine, and I am developing a potential implementation for working in this problem space. The idea involves usage of a neural network to classify training data. Once classified, sentences can be generated as a subset of intent which will drive the output.

Intent

This is a core concept for the whole system. Intent will be a pre-defined action item. These are essentially the classification outputs. An example of intent may include the following:

@SharpCoder
SharpCoder / fjs_tokenizer.cpp
Created July 18, 2015 00:09
Simple Tokenizer
#include "fjs_tokenizer.h"
List<Symbol> tokenize(char* str) {
string* temp = new string();
string* code = new string(str);
List<Symbol> result;
// Parse the code.
for ( int i = 0; i < code->size() ; i++ ) {
Changelog v0.1.1
- Mobile optimized interface
- Added solar system map, with new art!
- Balanced resource generation a bit more.
- Renamed the ship 'Mainstay' to 'Andromeda'.
- Renamed the ship 'Hummingbird' to 'Delta Wing'.
- Renamed the ship 'Bulwark' to 'Apollo'.
- Fixed a bug with the guild page which wasn't clearing textboxes after sending messages.
- Fixed a bug with attacking where you would attack yourself sometimes after capturing a planet.
- Fixed a bug with losing your home planet. How clicking the "circle" icon on the map will take you to your first planet, whatever that is at any given time.
@SharpCoder
SharpCoder / NaNoGenMo1
Last active December 27, 2015 17:09
Dynamic NaNoGenMo description engine.
George meanders in the bedroom. The chest of drawrs has a silver pair of clothes.
The armchair has a gold leather. George looks at Yoko, the Ruined Geisha Doll.
George meanders in the doll room. The armchair features a white porcelin doll.
George watches Yoko, the Ruined Geisha Doll. George runs in the bedroom.
The armchair features a black leather. The table features a chartreuse board game.
George notices Kishi, the Tiny Geisha Doll. George creeps in the doll room.
The porcelin doll has a large shoe. The geisha doll has a small dress.
George creeps in the bedroom. The queen bed features a dirty sheet.
The chest of drawrs has a clean pair of clothes.
George watches Yoko, the Ruined Geisha Doll. George walks in the bedroom.
@SharpCoder
SharpCoder / combat.js
Created December 29, 2015 21:18
combat system
// ships = [[shipName, qty]]
ShipManager.prototype.combat = function (user1, user1Ships, user2, user2Ships, mission, success, supressMessages, supressFleet1Death, supressFleet2Death) {
supressMessages = false || supressMessages;
// Calcualte the total attack power for each fleet.
var gameContext = this.gameContext,
fleet1Flat = [],
fleet2Flat = [];
// Populate the lists.
for (var i = 0; i < user1Ships.length; i++) {
@SharpCoder
SharpCoder / asdsa
Created January 5, 2016 06:52
dsadsa
// Mining ships
this.ships.push(new Ship({
title: 'Quarry',
description: 'A Class-I mining vessel. Tattered and old, but she\'ll get the job done!',
cost: 2000,
attack: 0,
defense: 20,
hp: 100,
miningIronMultiplier: 1.0,
miningGoldMultiplier: 1.0,
package com.debuggle.kale;
import java.util.Date;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.net.Uri;