Skip to content

Instantly share code, notes, and snippets.

View tyler569's full-sized avatar

Tyler Philbrick tyler569

  • San Francisco, USA
View GitHub Profile
package main
import "fmt"
type Register uint16
func (r Register) High() uint8 {
return uint8(r >> 8)
}
#![recursion_limit="579"]
fn main() {
let y = &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
@tyler569
tyler569 / chromosome.py
Created March 1, 2017 01:10
Python Genetic Reactor Optimizer
import random
from allowed_blocks import *
class Nucleotide(object):
def __init__(self, value = None):
if value is None:
self.value = random.choice(allowed_blocks)
elif type(value) is list:
self.value = random.choice(value)
(ns cljbot.core
(:require [clojure.string :as string]
[irclj.core :as irc]
[irclj.events :as events]))
(def server "irc.openredstone.org")
(def port 6667)
(def channel "#openredstone")
(def nick "tbot_4")
(def real "The 4th tbot")
#include <stdio.h>
#define string int
#define begin {
#define end }
#define return(x) printf("%s", x); return 0;
string main(int argc, char **argv)
begin
module Lib where
import Network
import Data.List
import System.IO
import Control.Arrow
import Control.Monad.Reader
import Control.Exception
import Text.Printf
package main
import (
// "errors"
"fmt"
)
type Stack []int
func (s *Stack) Put(elem int) {
trait AstElem[+T] {
def eval(): T
}
class LispFunction[-T, +R](f: List[T] => R) {
def apply(l: List[AstElem[T]]): R = {
f(l.map(_.eval()))
}
}
import java.io.PrintWriter
import java.net.{InetAddress, Socket}
import scala.io.BufferedSource
object Main {
def main(args: Array[String]) = {
val conn = new Socket(
InetAddress.getByName("irc.openredstone.org"),
6667
@tyler569
tyler569 / irc-minimal.scala
Last active August 29, 2015 14:25
Very minimal IRC connection in scala
import java.net._
import java.io._
import scala.io._
class IRC(server: String, nick: String, user: String, channel: String) {
val port = 6667
val host = InetAddress.getByName(server)
val sock = new Socket(host, port)
lazy val in = new BufferedSource(sock.getInputStream())
val out = new PrintStream(sock.getOutputStream())