Skip to content

Instantly share code, notes, and snippets.

View AlexCouch's full-sized avatar
😛
Who's asking...?

Alex Couch AlexCouch

😛
Who's asking...?
  • Spokane, Washington area
View GitHub Profile
@AlexCouch
AlexCouch / ecs.kt
Last active October 4, 2017 08:57
Kotlin ECS Basic
package com.mdc.kotlin
import java.util.*
import kotlin.collections.HashMap
typealias EntityID = Int
data class Position(var x: Int, var y: Int){
var _x = x
var _y = y
@AlexCouch
AlexCouch / ecs.kt
Created October 4, 2017 20:20
ECS Updated
package com.mdc.kotlin
import java.util.*
import kotlin.collections.HashMap
typealias ID = Int
data class Position(var x: Int, var y: Int){
var _x = x
var _y = y
@AlexCouch
AlexCouch / ecs.kt
Created October 4, 2017 23:40
ECS Kotlin Update #3
package com.mdc.kotlin
import java.util.*
import kotlin.collections.HashMap
typealias ID = Int
data class Position(var x: Int, var y: Int){
var _x = x
var _y = y
Console.WriteLine("Hello, and Welcome to your gas calculator!\r\n How many gallons does your car tank hold?");
//Save the response
string gallons = Console.ReadLine();
//Convert from string to int
int gallonsInt = int.Parse(gallons);
//Ask user how full is tank
Console.WriteLine("How full is your tank in % wise?");
//Save response
string fullness = Console.ReadLine();
class FishCounter{
enum Colors{
Red(1, "red"),
Blue(2, "blue"),
Green(3, "green"),
Yellow(4, "yellow");
private int id;
private String name;
@AlexCouch
AlexCouch / trigger
Last active November 9, 2017 21:43
bring System into this <- end
function void main[args = String = Array : default = no]: const = no(
class new -> Maths : parent = no(
member function (not int, float, double, long, short, char, or string) add[num1 < Integer with-default = no, num2 < Integer with-default = no] | const = no(
%^
^ This is a multi-line comment, and there is no return keyword. If you are doing one thing, then you can do that thing in the
^ "return" statement, and then
^ specify the return value using a colon (a return value determiner)
^%
lexer grammar CrayScriptLexer;
Function : 'function' ;
Integer : 'int' ;
Double : 'double' ;
Type : 'type' ;
If : 'if' ;
For : 'for' ;
ForEach : 'foreach' ;
While : 'while' ;
parser grammar CrayScriptParser;
options{
tokenVocab=CrayScriptLexer;
}
block:
CurlyBraceLeft WS* statementList? WS* CurlyBraceRight
;
@Override
public void onTick() {
if (++counter == 200) {
OnlineRequest.getInstance().make("http://centralos.x10host.com/chat/chat.html", new ResponseHandler() {
@Override
public void handle(boolean success, String response) {
//This should not be here
if (currentData == response){
//chat.addItem("if"+response);
package ocdiary.theoink.handlers;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.DamageSource;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.event.entity.living.LivingFallEvent;