Skip to content

Instantly share code, notes, and snippets.

@jimmykurian
jimmykurian / Car.trc
Created February 6, 2012 16:47
Simple animation program written in TrueBASIC.
!Car.trc - Jimmy Kurian
SET WINDOW 0,20,0,20
SET COLOR 5
BOX AREA 2,6,2,3
BOX AREA 9,13,2,3
BOX AREA 16,20,2,3
SET COLOR 249
PLOT LINES :0,5;20,5
FLOOD 10,1
@jimmykurian
jimmykurian / BasicIO.rb
Created February 6, 2012 16:59
A basic I/O program written in Ruby.
# BasicIO.rb - Jimmy Kurian
print "Please enter a past-tense verb: "
verb = gets.chomp
print "Please enter a noun: "
noun = gets.chomp
print "Please enter a proper noun: "
prop_noun = gets.chomp
print "Please enter a an adverb: "
adv = gets.chomp
@jimmykurian
jimmykurian / FileIO.rb
Created February 6, 2012 17:01
Basic File I/O program, written in Ruby.
# FileIO.rb - Jimmy Kurian
print "Please enter a past-tense verb: "
verb = gets.chomp
print "Please enter a noun: "
noun = gets.chomp
print "Please enter a proper noun: "
prop_noun = gets.chomp
print "Please enter a an adverb: "
adv = gets.chomp
@jimmykurian
jimmykurian / HelloWorld.scm
Created February 17, 2012 18:09
A simple Hello World program written in the Scheme programming language.
;HelloWorld.scm - Jimmy Kurian
(begin
(display "Hello, World!")
(newline))
@jimmykurian
jimmykurian / HelloWolrd.pl
Created February 17, 2012 18:30
A simple Hello World written in GNU Prolog implementation of the Prolog logic based programming language.
%HelloWorld.pl - Jimmy Kurian
write('Hello, World!'), nl.
@jimmykurian
jimmykurian / Square.java
Created February 18, 2012 01:57
A Java program that reads in n^2 values from the keyboard and test whether they form a magic square when arranged as a square matrix.
//Square.java - Jimmy Kurian
import java.util.Scanner;
public class Square
{
//Constructs a n x n square filled with zeros.
public Square(int n)
{
@jimmykurian
jimmykurian / BarChart.java
Created February 18, 2012 02:25
A Java program that displays a bar chart of the added values.
//BarChart.java - Jimmy Kurian
import java.util.ArrayList;
import java.awt.Graphics2D;
import java.awt.geom.Line2D;
import java.awt.geom.Point2D;
import java.awt.Rectangle;
public class BarChart
{
@jimmykurian
jimmykurian / Geometry.java
Created February 21, 2012 05:38
A Java program that will compute the volume and surface area of a sphere with radius r, a cylinder with circular base with radius r and height h, and a cone with circular base with radius r and height h.
//Geometry.java - Jimmy Kurian
public class Geometry
{
public static double sphereVolume(double r)
{
return (4.0 / 3.0) * Math.PI * r * r * r;
}
@jimmykurian
jimmykurian / Cone.java
Created February 21, 2012 05:41
An object oriented version of Geometry.java that will compute the volume and surface area of a sphere with radius r, a cylinder with circular base with radius r and height h, and a cone with circular base with radius r and height h. Written in Java.
//Cone.java - Jimmy Kurian
public class Cone
{
private double r;
private double h;
public Cone(double aRadius, double aHeight)
{
r = aRadius;
@jimmykurian
jimmykurian / BankAccount.java
Created March 13, 2012 05:18
A modified implementation of the DataSet class to use both a Measurer and a Filter object.
//BankAccount.java - Jimmy Kurian
public class BankAccount
{
private double balance;
public BankAccount()
{
balance = 0;
}