This file contains 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
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:"); |
This file contains 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
@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 |
This file contains 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
//------------------------------------------------------------------------------------------------------------------ | |
// 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(){ |
This file contains 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
class Vehicle | |
attr_reader :color, :wheels | |
def initialize(args) | |
@color = args[:color] | |
@wheels = 4 | |
end | |
end | |
class Car < Vehicle | |
attr_reader |