Skip to content

Instantly share code, notes, and snippets.

import java.util.Scanner;
import java.util.ArrayList;
import java.util.List;
import java.util.Collections;
public class DictionarySort {
public static void main(String[] args){
List<String> dictionary = new ArrayList<String>();
System.out.print("Enter a word:");
@bhancock96
bhancock96 / deck_of_cards.rb
Last active August 29, 2015 14:02
Create and shuffle a deck of cards
@suits = ['S', 'H', 'D', 'C']
@numbers = ['2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K', 'A']
def deck
deck = []
@suits.each do |suit|
@numbers.each do |num|
deck << "#{suit} #{num}"
end
end
@bhancock96
bhancock96 / zoo.js
Last active December 21, 2015 03:28 — forked from dbc-challenges/zoo.js
//------------------------------------------------------------------------------------------------------------------
// YOUR CODE: Create your Zoo "object literal" and Animal "constructor" and "prototypes" here.
//------------------------------------------------------------------------------------------------------------------
function Animal(name, legs){
this.name = name
this.legs = legs
}
Animal.prototype.identify = function(){
class Vehicle
attr_reader :color, :wheels
def initialize(args)
@color = args[:color]
@wheels = 4
end
end
class Car < Vehicle
attr_reader