This file contains hidden or 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
#!/usr/bin/env ruby | |
# Problem 4 | |
# ECOO 2011 Perimeter Trees | |
# Andrew Horsman | |
class Point < Struct.new(:x, :y); end | |
class Line | |
def initialize(x1, y1, x2, y2) |
This file contains hidden or 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
#pragma config(Sensor, dgtl1, sda, sensorDigitalOut) | |
#pragma config(Sensor, dgtl2, scl, sensorDigitalOut) | |
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*// | |
#define I2C_DELAY_COUNT 300 | |
#define READ false | |
#define WRITE true | |
void i2c_delay() { | |
for (int i = 0; i < I2C_DELAY_COUNT; ++i) {} |
This file contains hidden or 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
require 'pp' | |
$glob_store = [] | |
def get_key_sets(temp, previous_set = nil) | |
temp.each_with_index do |value, index| | |
if previous_set.nil? | |
new_set = [] | |
else | |
new_set = previous_set.dup |
This file contains hidden or 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
#!/usr/bin/env ruby | |
data = [] | |
file_data = File.read(ARGV[0]).split("\n") | |
is_case_line = false | |
1.upto(file_data.length - 1) do |i| | |
data << file_data[i].split(" ").map { |n| n.to_i } if is_case_line | |
is_case_line = (is_case_line) ? false : true | |
end |
This file contains hidden or 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
#pragma config(Motor, port6, rightFront, tmotorNormal, openLoop) | |
#pragma config(Motor, port7, rightBack, tmotorNormal, openLoop) | |
#pragma config(Motor, port8, leftFront, tmotorNormal, openLoop, reversed) | |
#pragma config(Motor, port9, leftBack, tmotorNormal, openLoop, reversed) | |
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*// | |
/* | |
* @author: Andrew Horsman | |
* @description: First Vex robot with the Cortex microcontroller. | |
* ~ 2x16 LCD |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# Brainfuck Interpreter | |
class Runtime | |
def initialize(program) | |
@data = [0] | |
@data_ptr = 0 | |
@inst_ptr = 0 |
This file contains hidden or 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
#!/usr/bin/env io | |
# LispML (XML Builder) | |
# Assignment from Seven Languages in Seven Weeks Chapter 2 | |
Builder := Object clone | |
Builder forward := method( | |
tag := call message name | |
temp := Map clone | |
temp atPut(tag, list) |
This file contains hidden or 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
book_author('JavaScript The Good Parts', 'Douglas Crockford'). | |
book_author('Seven Languages in Seven Weeks', 'Bruce A. Tate'). | |
book_author('Rework', 'Jason Fried'). | |
book_author('The Little Schemer', 'Daniel P. Friedman'). | |
book_author('Code Complete', 'Steve McConnell'). | |
book_author('Software Estimation', 'Steve McConnell'). | |
book_author('Software Project Survival Guide', 'Steve McConnell'). | |
% Note: These genres are totally inaccurate, but I'm lazy. | |
book_genre('JavaScript The Good Parts', 'Web Development'). |
This file contains hidden or 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
// Original code by Code Jam user SkidanovAlexander, only comments have been added for analysis purposes. | |
// Analysis done on 05/20/2011 | |
#define _CRT_SECURE_NO_DEPRECATE | |
#include <stdio.h> | |
#include <iostream> | |
#include <memory.h> | |
#include <assert.h> | |
#include <algorithm> |
This file contains hidden or 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
" Vim configuration - Andrew Horsman [basicxman] | |
" Operating system dependent options | |
if has("win32") || has("unix") | |
source $VIMRUNTIME/mswin.vim | |
behave mswin | |
endif | |
if has("win32") | |
:cd C:\Users\Andrew |