Skip to content

Instantly share code, notes, and snippets.

@macroxela
macroxela / DataStructures.h
Created April 23, 2014 22:00
An OpenGL application that creates visual representations of various data structures. The user can add and remove elements from the data structures and observe what happens in real time.
#ifndef DATA_AM
#define DATA_AM
#include <iostream>
#include <stdlib.h>
#include <GL/glut.h>
#include <stdio.h>
#include <stdlib.h>
#include<time.h>
using namespace std;
@macroxela
macroxela / NQueen.cpp
Created April 23, 2014 22:21
A genetic algorithm implementation for the N-Queen problem. It outputs the solution as a vector in which the position denotes the column and number denotes row on the chessboard
/*
Alex Marroquin
CSCI 4350 Artificial Intelligence
Homework 3: N-Queen Solution with Genetic Algorithm
main.cpp
*/
#include<iostream>
#include<fstream>
@macroxela
macroxela / Djikstra.cpp
Created April 23, 2014 22:41
Djikstra's algorithm implementation in C++. Given the input file it outputs the shortest path between the 2 given points symbolically in the output text file.
/*
Alex Marroquin
CSCI 3333
11-21-12
Homework 8: Djikstra's Algorithm with Heap implementation
main.cpp
*/
#include<string>
#include<iostream>
@macroxela
macroxela / ACO.cpp
Created April 24, 2014 00:33
Ant Colony Optimization implementation for finding the shortest path between 2 cities given in the input file. The input file also contains the map data (city names and distances).
/*
Alex Marroquin
CSCI 4350 Artificial Intelligence
Homework 2: Ant Colony Optimization Implementation
main.cpp
*/
#include<iostream>
#include<string>
@macroxela
macroxela / AStar.cpp
Created April 24, 2014 00:44
A* Implementation for shortest path between 2 cities given map data from input file.
/*
Alex Marroquin
CSCI 4350 Artificial Intelligence
Homework 1: A* Implementation
main.cpp
Given an input file with the list of all the cities, edges, and other data the A* algorithm
must find the shortest path between 2 locations depending on the heuristic. In this case
the heuristic must depend on the straight line distance to the destination, distance from the
@macroxela
macroxela / AVLTree.h
Last active August 29, 2015 14:00
A hash table and AVL tree to store and retrieve student student data
// CSCI 3333 Data Structures & Algorithms
// Alex Marroquin
// 9-21-12
// Hwk #4: Speed Table - AVLTree.h
//AVL tree used to store student data
#include<iostream>
#include<string>
@macroxela
macroxela / Alien.java
Created April 24, 2014 01:46
A Galaga game developed in Java
import java.util.*;
public class Alien extends GameObject
{
Random dice;
int cnt = 1;
int dx;
int rand = 0;
boolean shot;
@macroxela
macroxela / PSO.cpp
Created April 24, 2014 01:52
Particle Swarm Optimization using OpenGL and C++. Creates various particles and allows the user to add/remove particles and manipulate variables in PSO algorithm to view effects on particles.
#include <GLUT/glut.h>
#include <stdlib.h>
#include<iostream>
#include<fstream>
#include<string>
#include<time.h>
using namespace std;
float radius;
@macroxela
macroxela / Brick.java
Created April 24, 2014 23:11
A brickout game implemented in Java. The player bounces the ball around with the paddle to destroy as many bricks as possible.
import java.awt.*;
public class Brick {
int x, y;
int width, height;
boolean broken;
Brick()
{
x = 0;
@macroxela
macroxela / Frog.java
Created April 24, 2014 23:20
A Frogger game where the user tries to get the frog across the street to the log without getting run over or drowning.
import java.awt.*;
import javax.swing.*;
public class Frog extends Rectangle
{
ImageIcon pic;
Frog()
{
x = 300;
y = 160;